Existing project need to use vue3.0,i add '@vue/composition-api' to my project。
dependencies:

Works fine in codepen https://codepen.io/jkarczm/pen/RwNgMQj?editors=1010
Thanks @jacekkarczmarczyk
@mbbbc open a new issue with a repro if you manage to reproduce it and make sure to use the latest version of Vue as well
open a new issue with a repro if you manage to reproduce it and make sure to use the latest version of Vue as well
if I use mixins to declares a method, then I rewrite this method in my component,and then I get this warning
Not sure but this bug still appears when doing test by mocking methods.
handler module:
{
...
...
return {
method1
}
}
export default handlerFn
vue component:
<template>
<button @clcik="method1"></button>
</template
const { method1 } = handlerFn()
setup(){
return{
method1
}
}
test with mock
const spy1 = jest.spyOn(handler, 'method1')
const w = mount(LoginComponent, {
mocks: {
method1: spy1
}
})
expect(spy1).toBeCalled()
The test passes but the warning never goes away.
[Vue warn]: The setup binding property "method1" is already declared.
tested on
"@vue/composition-api": "0.5.0", "0.6.7" & "1.0.0-beta.11"
It happened if I register VueCompositionAPI twice like this:
import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api'
Vue.use(VueCompositionAPI)
const localVue = createLocalVue()
localVue.use(VueCompositionAPI )
const wrapper = mount(Component, {
localVue
})
Not sure but this bug still appears when doing test by mocking methods.
handler module:
{ ... ... return { method1 } } export default handlerFnvue component:
<template> <button @clcik="method1"></button> </templateconst { method1 } = handlerFn() setup(){ return{ method1 } }test with mock
const spy1 = jest.spyOn(handler, 'method1') const w = mount(LoginComponent, { mocks: { method1: spy1 } }) expect(spy1).toBeCalled()The test passes but the warning never goes away.
[Vue warn]: The setup binding property "method1" is already declared.tested on
"@vue/composition-api": "0.5.0", "0.6.7" & "1.0.0-beta.11"
It happened if I register
VueCompositionAPItwice like this:import Vue from 'vue' import VueCompositionAPI from '@vue/composition-api' Vue.use(VueCompositionAPI) const localVue = createLocalVue() localVue.use(VueCompositionAPI ) const wrapper = mount(Component, { localVue })Not sure but this bug still appears when doing test by mocking methods.
handler module:{ ... ... return { method1 } } export default handlerFnvue component:
<template> <button @clcik="method1"></button> </templateconst { method1 } = handlerFn() setup(){ return{ method1 } }test with mock
const spy1 = jest.spyOn(handler, 'method1') const w = mount(LoginComponent, { mocks: { method1: spy1 } }) expect(spy1).toBeCalled()The test passes but the warning never goes away.
[Vue warn]: The setup binding property "method1" is already declared.tested on
"@vue/composition-api": "0.5.0", "0.6.7" & "1.0.0-beta.11"
@webrsb I only have localVue.use(VueCompositionAPI)
Most helpful comment
Not sure but this bug still appears when doing test by mocking methods.
handler module:
vue component:
test with mock
The test passes but the warning never goes away.
tested on
"@vue/composition-api": "0.5.0", "0.6.7" & "1.0.0-beta.11"