FranckFreiburger / vue3-sfc-loader

Single File Component loader for Vue2 and Vue3. Load .vue files directly from your HTML. No node.js environment, no build step.
MIT License
1.03k stars 116 forks source link

The computed property "xx" is already defined in data. #129

Closed bingxueyinlian closed 5 months ago

bingxueyinlian commented 2 years ago

Describe the bug When the data variable in the remote component has the same name as the computed property of the host page with mixin, an error is reported,like 'The computed property "aa" is already defined in data.' image

To Reproduce

remote component

<script>
export default {
  data() {
    return {
      aa: '',
    };
  },
};
</script>

host page with mixin mixin.js

let mixin = {
  computed: {
    aa() {
      return '123';
    },
  },
};
export default mixin;

main.js

import mixin from '@/mixin.js';
Vue.mixin(mixin);

Expected behavior The data variable definition of the remote component is independent of the computed property of the host page with mixin.

Versions

FranckFreiburger commented 5 months ago

Hello bingxueyinlian, this issue is not related to vue3-sfc-loader. see Vue SFC Playground