vuejs / composition-api

Composition API plugin for Vue 2
https://composition-api.vuejs.org/
MIT License
4.19k stars 343 forks source link

The setup binding property "xxx" is already declared. #963

Closed youuss closed 2 years ago

youuss commented 2 years ago

hi, when i use vue2.6.11 with @vue/composition-api@1.7.0, i got a vue warnning The setup binding property "test" is already declared.. I also provide a simple demo in https://codesandbox.io/s/objective-cohen-qf0uxk plz check that, thx

jacekkarczmarczyk commented 2 years ago

Your reproduction uses vue 2.7.x and it conflicts with composition api plugin, so either remove the plugin or use vue 2.6.x

youuss commented 2 years ago

Your reproduction uses vue 2.7.x and it conflicts with composition api plugin, so either remove the plugin or use vue 2.6.x

image

I just find vue 2.6.x

lmh-justdo commented 2 years ago

Maybe you need to check the vue version in node_modules actually has been installed. if the version >= 2.7, you just need to import from vue, when the version < 2.7, you need to follow the @vue/composition-api md steps.

Tzdy commented 2 years ago

把^2.6.11的^去掉,否则会下载2.7.x

youuss commented 2 years ago

把^2.6.11的^去掉,否则会下载2.7.x

嗯 但是老项目 不锁版本直接去install,如果不关注node_modules很容易产生类似情况