[Vue warn]: The setup binding property "xxx" is already declared.
See original GitHub issueExisting project need to use vue3.0,i add ‘@vue/composition-api’ to my project。 dependencies:
- “vue”: “2.5.22”, 2.“@vue/composition-api”: “^0.3.4”, I run the following code and the console prompts me: [Vue warn]: The setup binding property “state” is already declared. [Vue warn]: The setup binding property “increment” is already declared.
<template>
<button @click="increment">
Count is: {{ state.count }}, double is: {{ state.double }}
</button>
</template>
<script>
// import { reactive, computed } from 'vue'
import { computed, reactive } from '@vue/composition-api';
export default {
setup() {
const state = reactive({
count: 1,
double: 1,
})
state.double = computed(() => state.count * 2)
const increment = () => {
state.count++
}
return {
state,
increment
}
}
}
</script>

Issue Analytics
- State:
- Created 4 years ago
- Comments:30 (3 by maintainers)
Top Results From Across the Web
Webpack alias for loading external components, wrong ...
If I don't use " import Vue from 'vue'; import VueCompositionApi from ... [Vue warn]: The setup binding property “xxx” is already declared....
Read more >[Vue warn]: Invalid prop: type check failed for ... - Stack Overflow
Everything works fine but I get Vue warnings for all the declared props: [Vue warn]: Invalid prop: type check failed for prop "text"....
Read more >vue2中使用composition/api, script setup问题记录 - CSDN博客
The setup binding property “xxx” is already declared as a prop. 在这里插入图片描述 解决方法:除了在监听xxx时,其他地方使用props引入的变量时使用 ...
Read more >[vue3] Property xxx was accessed during render but is not ...
In Vue.js, the error generally means you are referring to a variable which could be a data, prop, method or computed property in...
Read more >property was accessed during render but is not defined on ...
StackOverflow · Create a temp folder, switch to it and initiate a node project: · create index.js : · Add required packages for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It happened if I register
VueCompositionAPItwice like this: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”