Skip to content

Commit 6283e05

Browse files
re4388phanan
andcommitted
[cookbook]Change "data" to a function (#2221)
* Change "data" to a function * Update src/v2/cookbook/unit-testing-vue-components.md Co-Authored-By: Phan An <me@phanan.net>
1 parent e9a592a commit 6283e05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/v2/cookbook/unit-testing-vue-components.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ import Foo from './Foo'
188188

189189
const factory = (values = {}) => {
190190
return shallowMount(Foo, {
191-
data: { ...values }
191+
data () {
192+
return {
193+
...values
194+
}
195+
}
192196
})
193197
}
194198

0 commit comments

Comments
 (0)