You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using class decorators in SFCs. I found a bug in the parsing algorithm. It only accepts page components which extend Vue directly. The parsing fails to find meta when the component uses mixins:
// pages/index.vue
import {Component, mixins} from 'nuxt-property-decorator';
import SomeMixin from '@/mixins/SomeMixin';
@Component({})
export default PageComponent extends mixins(SomeMixin) {
meta = {foo: 'bar'};
}
May I suggest parsing the @Component decorator options instead like so?: (only if the typescript AST parser allows it)
@Component({meta: {foo: 'bar'}})
The text was updated successfully, but these errors were encountered:
@dword-design In a decent IDE like WebStorm, you can get some basic type hints when defining meta in the decorator thanks to this, which does not happen when defining it as a property in the class body. Given this slight advantage, I would personally prefer decorator meta having precedence over component body meta. After all, it wouldn't make sense to define it in both places, since none of them have access to the encapsulating component, which would give it an advantage. That means all data in meta is most likely static and any merging can be done by the code author manually. What are your thoughts on this?
Hi, I'm using class decorators in SFCs. I found a bug in the parsing algorithm. It only accepts page components which extend Vue directly. The parsing fails to find
meta
when the component uses mixins:May I suggest parsing the
@Component
decorator options instead like so?: (only if the typescript AST parser allows it)The text was updated successfully, but these errors were encountered: