Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

is "metaInfo", at a "SubClass" level, supposed to be merged with a "SuperClass" component's "metaInfo"? #172

@akhoury

Description

@akhoury

Right now the whole metaInfo object gets overwritten.

Example code:

var SuperClass = Vue.extend({
    metaInfo: {
        titleTemplate: '%s - MyCompany'
    }
});

var SubClass = Vue.extend({
    // using this option: https://vuejs.org/v2/api/#extends
    extends: SuperClass, 

    metaInfo: {
        title: 'Home Page'
    }
}); 

var app = new SubClass({
    el: '#app'    
});

console.log( app.$options.metaInfo );
/// { title: "Home Page" }

Live example code:

Use case

It's nice to have a Page superclass component that all the other "pages" (pages, and not all the other "components") extends, this way we can have a titleTemplate for all, and each page would just override the title property.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions