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.

changed() function in metaInfo returns Object with metaInfo instead of Vue instance #128

@MDSLKTR

Description

@MDSLKTR

Hey,

first of thanks for this great plugin! I have a question though. When using the changed function i currently have no way of telling my Vue Instance that metaInfo has in fact changed. In my current implementation as described in the docs it returns a simple object containing all meta data instead of the mounted Vue Instance. Is this behaviour intended?

Vue Meta 1.0.5

   export default {
        props: {
            socialText: String,
            inverted: Boolean,
        },
        data() {
            return {
                url: window.location.origin,
                title: '',
                description: '',
                quote: '',
            };
        },

        metaInfo: {
            changed() {
                this.title = document.querySelector('meta[property="og:title"]').content;
                this.description = document.querySelector('meta[property="og:description"]').content;
                this.quote = document.querySelector('meta[property="share-text"]').content;


               // this returning itself instead of the vue instance
                console.log(this);
            },
        },
    };

Thanks in advance,
Simon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions