File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/vue-final-modal/src/components/CoreModal Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1- import { computed , nextTick , ref , watch } from 'vue'
1+ import { nextTick , ref , watch } from 'vue'
2+ import type { Ref } from 'vue'
23import type CoreModal from './CoreModal.vue'
34
45export function useModelValue (
@@ -16,12 +17,16 @@ export function useModelValue(
1617 const _modelValueLocal = ref < boolean > ( false )
1718
1819 /**
19- * A WritableComputedRef, a only variable to control open or close the modal
20+ * The proxy of `_modelValueLocal`
2021 */
21- const modelValueLocal = computed ( {
22- get : ( ) => _modelValueLocal . value ,
23- set : setModelValueLocal ,
24- } )
22+ const modelValueLocal = {
23+ get value ( ) {
24+ return _modelValueLocal . value
25+ } ,
26+ set value ( val : boolean ) {
27+ setModelValueLocal ( val )
28+ } ,
29+ } as Ref < boolean >
2530
2631 /**
2732 * Because of the open/close can be stopped in `@beforeOpen`, `@beforeClose` events.
You can’t perform that action at this time.
0 commit comments