Skip to content

Commit 97574c9

Browse files
fix: fixed data arrow function
1 parent 706a8cd commit 97574c9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/guide/migration/render-function-api.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,14 @@ In 2.x, when a component has been registered, the render function would work wel
137137
```js
138138
// 2.x
139139
Vue.component('button-counter', {
140-
data: () => ({
141-
count: 0
142-
}),
140+
data() {
141+
return {
142+
count: 0
143+
}
144+
}
143145
template: `
144146
<button @click="count++">
145-
Clicked {{ count }} times.
147+
Clicked {{ count }} times.
146148
</button>
147149
`
148150
})

0 commit comments

Comments
 (0)