Skip to content

Commit 1868613

Browse files
fix two way model value binding
1 parent 0347ff6 commit 1868613

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/plugin/VResizeDrawer.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<v-navigation-drawer
33
v-bind="bindingSettings"
44
ref="resizeDrawer"
5+
v-model="internalModelValue"
56
:class="drawerClasses"
67
:location="settings.location"
7-
:model-value="modelValue"
88
:name="settings.name"
99
:style="drawerStyles"
1010
:tag="settings.tag"
@@ -106,6 +106,8 @@ const emit = defineEmits([
106106
]);
107107
108108
109+
const internalModelValue = defineModel<boolean>('modelValue', { default: false });
110+
109111
// -------------------------------------------------- Props //
110112
const props = withDefaults(defineProps<Props>(), { ...AllProps });
111113
@@ -204,7 +206,7 @@ function init(): void {
204206
205207
206208
// -------------------------------------------------- Model Watcher //
207-
watch(() => props.modelValue, (val) => {
209+
watch(() => internalModelValue, (val) => {
208210
emit('update:modelValue', val);
209211
210212
if (!val) {

src/plugin/types/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export interface Props {
4646
maxWidth?: VNavigationDrawer['width'];
4747
minHeight?: Height;
4848
minWidth?: VNavigationDrawer['width'];
49-
modelValue?: VNavigationDrawer['modelValue'];
5049
name?: VNavigationDrawer['name'];
5150
rail?: VNavigationDrawer['rail'];
5251
railWidth?: VNavigationDrawer['railWidth'];

src/plugin/utils/props.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const AllProps: Props = {
1414
maxWidth: window.innerWidth,
1515
minHeight: 56,
1616
minWidth: 56,
17-
modelValue: true,
1817
name: undefined,
1918
rail: false,
2019
railWidth: 8,

0 commit comments

Comments
 (0)