File tree Expand file tree Collapse file tree 2 files changed +16
-21
lines changed Expand file tree Collapse file tree 2 files changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,17 @@ import { watchEffect } from 'vue'
3
3
import BaseButton from ' ./BaseButton.vue'
4
4
import { DURATION } from ' ./utils.js'
5
5
6
- const props = defineProps ({
7
- visible: {
8
- required: true ,
9
- type: Boolean
10
- }
6
+ const visible = defineModel (' visible' , {
7
+ required: true ,
8
+ type: Boolean
11
9
})
12
10
13
- const emit = defineEmits ([' update:visible' ])
14
-
15
11
watchEffect (() => {
16
- document .body .style .overflow = props . visible ? ' hidden' : ' '
12
+ document .body .style .overflow = visible . value ? ' hidden' : ' '
17
13
})
18
14
19
15
function close () {
20
- emit ( ' update: visible' , false )
16
+ visible . value = false
21
17
}
22
18
</script >
23
19
Original file line number Diff line number Diff line change @@ -8,21 +8,20 @@ const props = defineProps({
8
8
stillRemaining: {
9
9
required: true ,
10
10
type: Array
11
- },
12
- step: {
13
- required: true ,
14
- type: Array
15
11
}
16
12
})
17
13
18
- const emit = defineEmits ([' update:step' ])
14
+ const step = defineModel (' step' , {
15
+ required: true ,
16
+ type: Array
17
+ })
19
18
20
19
const firstNumIndex = ref (null )
21
20
const secondNumIndex = ref (null )
22
21
23
- const firstNum = computed (() => props . step [0 ])
24
- const selectedOp = computed (() => props . step [1 ])
25
- const secondNum = computed (() => props . step [2 ])
22
+ const firstNum = computed (() => step . value [0 ])
23
+ const selectedOp = computed (() => step . value [1 ])
24
+ const secondNum = computed (() => step . value [2 ])
26
25
27
26
const getIndexedNumberList = () => {
28
27
return props .stillRemaining .map ((value , index ) => ({
@@ -104,12 +103,12 @@ watchEffect(() => {
104
103
}
105
104
})
106
105
107
- function updateStep (... step ) {
108
- while (step .length && step[ step .length - 1 ] == null ) {
109
- step .pop ()
106
+ function updateStep (... newStep ) {
107
+ while (newStep .length && newStep[ newStep .length - 1 ] == null ) {
108
+ newStep .pop ()
110
109
}
111
110
112
- emit ( ' update: step' , step)
111
+ step . value = newStep
113
112
}
114
113
115
114
function onFirstClick (index ) {
You can’t perform that action at this time.
0 commit comments