Skip to content

Meta is not parsed when page component uses mixins #103

Open
@dovca

Description

@dovca

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'}})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions