Skip to content

Commit 3700fc6

Browse files
committed
71
1 parent eecee64 commit 3700fc6

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

db.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@
4444
"subject": "12",
4545
"completed": true,
4646
"id": 15
47-
},
48-
{
49-
"subject": "123",
50-
"completed": true,
51-
"id": 16
52-
},
53-
{
54-
"subject": "1234",
55-
"completed": false,
56-
"id": 17
5747
}
5848
]
5949
}

src/components/DeleteModal.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525

2626
<script>
2727
import Modal from '@/components/Modal.vue';
28+
import { useContext } from 'vue';
2829
2930
export default {
3031
components: {
3132
Modal
3233
},
33-
setup(props, { emit }) {
34+
setup() {
35+
const { emit } = useContext();
3436
const onClose = () => {
3537
emit('close');
3638
}

src/components/Input.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
</template>
1818

1919
<script>
20+
import { useContext } from 'vue';
2021
export default {
2122
props: {
2223
label: {
@@ -32,7 +33,8 @@ export default {
3233
required: true
3334
}
3435
},
35-
setup(props, { emit }) {
36+
setup() {
37+
const { emit } = useContext();
3638
const onInput = (e) => {
3739
emit('update:subject', e.target.value);
3840
};

src/components/Modal.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
</template>
2323

2424
<script>
25+
import { useContext } from 'vue';
26+
2527
export default {
26-
setup(props, { emit }) {
28+
setup() {
29+
const { emit } = useContext();
2730
const onClose = () => {
2831
emit('close');
2932
}

src/components/TodoSimpleForm.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
</template>
2626

2727
<script>
28-
import { ref } from 'vue';
28+
import { ref, useContext } from 'vue';
2929
3030
export default {
3131
emits: ['add-todo'],
32-
setup(props, { emit }) {
32+
setup() {
33+
const { emit } = useContext();
3334
const todo = ref('');
3435
const hasError = ref(false);
3536
const onSubmit = () => {

0 commit comments

Comments
 (0)