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'
2
3
import type CoreModal from './CoreModal.vue'
3
4
4
5
export function useModelValue (
@@ -16,12 +17,16 @@ export function useModelValue(
16
17
const _modelValueLocal = ref < boolean > ( false )
17
18
18
19
/**
19
- * A WritableComputedRef, a only variable to control open or close the modal
20
+ * The proxy of `_modelValueLocal`
20
21
*/
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 >
25
30
26
31
/**
27
32
* Because of the open/close can be stopped in `@beforeOpen`, `@beforeClose` events.
You can’t perform that action at this time.
0 commit comments