Skip to content

Commit dd07c8a

Browse files
add watcher to width prop
1 parent bee5704 commit dd07c8a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/plugin/VResizeDrawer.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ watchEffect(() => {
116116
settings.value = { ...props, ...injectedOptions };
117117
});
118118
119+
watch(() => props.width, (newVal) => {
120+
defaultWidth.value = newVal;
121+
resizedAmount.value = useConvertToUnit({ value: newVal }) || undefined;
122+
123+
useSetStorage({
124+
rail: settings.value.rail,
125+
resizedAmount: resizedAmount.value,
126+
saveAmount: settings.value.saveHeight || settings.value.saveWidth,
127+
storageName: storageNameInternal.value,
128+
storageType: settings.value.storageType,
129+
});
130+
});
131+
119132
const handleIconSizeInternal = toRef(settings.value, 'handleIconSize');
120133
const handlePositionInternal = toRef(settings.value, 'handlePosition');
121134

0 commit comments

Comments
 (0)