nuxt-community / nuxt-property-decorator

Property decorators for Nuxt (base on vue-property-decorator)
https://github.com/kaorun343/vue-property-decorator
MIT License
400 stars 34 forks source link

Change component name when production build #70

Closed dungsil closed 3 years ago

dungsil commented 4 years ago

When registering a component with plugin, if you register as Vue.component(MyComponent.name, MyComponent), the component name will be different during production build.

link

atinux commented 3 years ago

@husayt would be mind looking at it? You are the expert of this package :grinning:

husayt commented 3 years ago

This library is just a Nuxt wrapper over Vue-class-component. As such any behavour specifics need to be checked on their forum.

On my side, I could guess that difference in behavior is due to js minification which happens in prod build. Logic which is based on class names is very error prone, as class names change on build.

To have more control, one could add explicit class name:

@Component({ name: "Privet" })

I did change an example above, to demonstrate that here: https://codesandbox.io/s/nuxt-issue-forked-zfkkq

Also, probably all this is really unnecessary since Nuxt has components auto discovery now with components : true flag.

I will close this issue here. If still any question check with vue-class-component team.