-
Notifications
You must be signed in to change notification settings - Fork 668
data should be function #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Would you like to open a PR to make the change? |
Does it have to be a function? https://vuejs.org/v2/examples/ new Vue({
el: '#editor',
data: {
input: '# hello'
},
computed: {
compiledMarkdown: function () {
return marked(this.input, { sanitize: true })
}
},
methods: {
update: _.debounce(function (e) {
this.input = e.target.value
}, 300)
}
}) E: Ahh I see this is a simple example which isn't a reusable component... makes sense. 😄 |
It doesn't have to be, no. ~~The test works correctly, although it will log a
warning in the latest vue version~~
I was wrong about this. The test fails when data is a function
…On Wed, 4 Jul 2018, 12:54 Mardoxx, ***@***.***> wrote:
Does it have to be a function?
https://vuejs.org/v2/examples/
new Vue({
el: '#editor',
data: {
input: '# hello'
},
computed: {
compiledMarkdown: function () {
return marked(this.input, { sanitize: true })
}
},
methods: {
update: _.debounce(function (e) {
this.input = e.target.value
}, 300)
}
})
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#797 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMlbW7AcLdpxHXHH5h0PBF44EHXfB0TXks5uDKzqgaJpZM4VBBS5>
.
|
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
1.0.0-beta.20
Reproduction link
vue-test-utils/test/specs/mounting-options/localVue.spec.js
Line 20 in 1ee03ac
Steps to reproduce
Open this:
vue-test-utils/test/specs/mounting-options/localVue.spec.js
Line 20 in 1ee03ac
should be written as
What is expected?
data: () => ({ test: '' })
What is actually happening?
data: { test: '' }
https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function
The text was updated successfully, but these errors were encountered: