Skip to content

Commit 2122bd6

Browse files
committed
Use 2-way binding props instead of watching data property in EditingScreen.vue
1 parent ef2b5d9 commit 2122bd6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/components/EditingScreen.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<template>
2-
<v-bottom-sheet v-model="screen" no-click-animation persistent scrollable>
2+
<v-bottom-sheet
3+
:value="expanded"
4+
no-click-animation
5+
persistent
6+
scrollable
7+
@input="$emit('update:expanded', $event)"
8+
>
39
<v-card class="EditingScreen">
410
<v-card-title class="EditingScreen-CardElements">
511
<v-container class="EditingScreen-Container">
@@ -100,7 +106,6 @@ type FourthPageDataType = {
100106
}
101107
102108
type DataType = {
103-
screen: boolean
104109
page: number
105110
error: boolean
106111
lessonId: string
@@ -158,7 +163,6 @@ export default Vue.extend({
158163
},
159164
data(): DataType {
160165
return {
161-
screen: this.expanded,
162166
page: 1,
163167
error: false,
164168
isHidden: this.value.isHidden,
@@ -199,9 +203,6 @@ export default Vue.extend({
199203
}
200204
},
201205
watch: {
202-
expanded(newValue) {
203-
this.screen = newValue
204-
},
205206
value(value) {
206207
this.isHidden = value.isHidden
207208
this.lessonId = value.lessonId

src/pages/edit/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<editing-screen
3535
:value="editPageValue"
3636
:expanded="!isExpandedButton"
37+
@update:expanded="isExpandedButton = $event"
3738
@collapse="closeToReset"
3839
/>
3940
</div>

0 commit comments

Comments
 (0)