StaticMenu.vue 952 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <script>
  2. import { mapActions, mapState } from 'pinia'
  3. import { StaticsStore } from '@/stores/statics'
  4. export default {
  5. props: [],
  6. data(){
  7. return {
  8. // block: null
  9. }
  10. },
  11. computed: {
  12. ...mapState(StaticsStore,['statics'])
  13. },
  14. created () {
  15. console.log("infos created");
  16. this.loadStatics()
  17. },
  18. methods: {
  19. ...mapActions(StaticsStore,['loadStatics'])
  20. },
  21. components: {
  22. // LoginBlock,
  23. // UserTools
  24. }
  25. }
  26. </script>
  27. <template>
  28. <ul>
  29. <li
  30. v-for="staticnode in statics"
  31. v-bind:key="staticnode.id"
  32. >
  33. <router-link :to="{ name: 'static', params: { id:staticnode.id } }">{{staticnode.title}}</router-link>
  34. </li>
  35. </ul>
  36. </template>
  37. <style lang="scss" scoped>
  38. ul{
  39. padding: 0;
  40. margin: 0;
  41. display: flex;
  42. flex-direction: row;
  43. }
  44. li{
  45. padding: 0;
  46. margin: 0;
  47. list-style: none;
  48. display: flex;
  49. a{
  50. @include btn();
  51. }
  52. }
  53. </style>