init component
This commit is contained in:
26
node_modules/buetify/lib/composables/proxy/useProxy.js
generated
vendored
Executable file
26
node_modules/buetify/lib/composables/proxy/useProxy.js
generated
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
import { shallowRef, watch, computed, unref } from 'vue';
|
||||
export function useProxy(ref, onUpdate) {
|
||||
const internalValue = shallowRef(ref.value);
|
||||
watch(ref, newValue => {
|
||||
internalValue.value = newValue;
|
||||
});
|
||||
const value = computed({
|
||||
get() {
|
||||
return internalValue.value;
|
||||
},
|
||||
|
||||
set(val) {
|
||||
internalValue.value = val;
|
||||
const update = unref(onUpdate);
|
||||
|
||||
if (update) {
|
||||
update(val);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return {
|
||||
value
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=useProxy.js.map
|
||||
Reference in New Issue
Block a user