Skip to content

Commit 1939906

Browse files
committed
using composition api
1 parent 2458f6b commit 1939906

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

tests/unit/example.spec.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { mount } from "@vue/test-utils";
2+
import { ref } from "vue";
23

34
const App = {
4-
data: () => ({
5-
count: 0,
6-
}),
7-
methods: {
8-
increment() {
9-
this.count += 1;
10-
},
5+
setup() {
6+
const count = ref(0);
7+
const increment = () => (count.value += 1);
8+
9+
return { count, increment };
1110
},
1211
template: `
1312
<button @click="increment"></button>

0 commit comments

Comments
 (0)