vuejs / composition-api

Composition API plugin for Vue 2

Home Page:https://composition-api.vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The setup binding property "XYZ" is already declared.

AkashJeedigunta opened this issue · comments

commented

Hi I have a project that runs on Vue 2 and will be moved to Vue 3 soon, Before that, I have a POC to check and learn how this vue-composition API works. So the setup and all went really well and no functional issues for the component.

However, I keep getting The setup binding property "XYZ" is already declared for all the data variables that were initialized and are returned at the end of the setup(). If I don't return{} they are not referenced.

Please if anyone can help me fix the issue.

Here is the basic snippet I initially started

import {
    ref,
    reactive,
} from "@vue/composition-api";


export default {
  setup() {
      const isLoading = ref(false);
      const user = ref('Akash');
  }

  return{
      isLoading,
      user
  }

}
</script>
commented

I figured that I have the same component that is being loaded in multiple places so are the errors. Have to figure out how to resolve it. Hence closing this issue