You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25
Original file line number
Diff line number
Diff line change
@@ -68,3 +68,28 @@ Assign a ref to the Drawer component
68
68
```
69
69
70
70
And use `this.$refs.drawer.open(side)` where `side` is a string: `left`, `right`, `top` or `bottom`.
71
+
72
+
### Using v-model to toggle the drawer
73
+
74
+
The drawer can be opened through v-model. This is useful as it allows controlling the drawer state with Vue's reactivity system. For example, the value of v-model could easily come from a vuex store.
75
+
76
+
```xml
77
+
<MultiDrawerv-model="drawerState" />
78
+
```
79
+
80
+
```js
81
+
exportdefault {
82
+
data() {
83
+
return {
84
+
drawerState:false// closed
85
+
}
86
+
},
87
+
88
+
methods: {
89
+
doStuff() {
90
+
// do stuff
91
+
this.drawerState='left'// this will open the left drawer
0 commit comments