Advertisement
rs_al

Untitled

Mar 23rd, 2022
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. <template>
  2. <v-navigation-drawer
  3.  
  4. v-model="drawerState"
  5. clipped
  6. >
  7. <v-list
  8. >
  9. <v-list-item
  10. v-for="item in menu.items"
  11. :key="item.title"
  12. :to="item.link"
  13. link
  14. >
  15. <v-list-item-icon>
  16. <v-icon>{{ item.icon }}</v-icon>
  17. </v-list-item-icon>
  18. <v-list-item-content>
  19. <v-list-item-title>{{ item.title }}</v-list-item-title>
  20. </v-list-item-content>
  21. </v-list-item>
  22. </v-list>
  23. </v-navigation-drawer>
  24. </template>
  25.  
  26. <script>
  27.  
  28. import { watch, ref } from 'vue'
  29.  
  30. export default {
  31.  
  32. props:{
  33. drawerStateInput:Boolean
  34. },
  35.  
  36. setup(props) {
  37. const menu = ref({items:
  38. [
  39. {
  40. title: '1',
  41. link: '/tasks',
  42. icon: 'mdi-briefcase-clock'
  43. },
  44. {
  45. title: '2',
  46. link: '/catalogues',
  47. icon: 'mdi-book'
  48. },
  49. {
  50. title: '3',
  51. link: '/registries',
  52. icon: 'mdi-file-table-box-multiple-outline'
  53. },
  54. {
  55. title: '4',
  56. link: '/files',
  57. icon: 'mdi-file-tree'
  58. },
  59. ]})
  60.  
  61. const drawerState = ref(props.drawerStateInput)
  62.  
  63. watch(() => props.drawerStateInput, (value) => {
  64. drawerState.value = value
  65. console.log(drawerState.value)
  66. })
  67.  
  68.  
  69. return {
  70. menu
  71. }
  72. }
  73. }
  74. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement