Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MDSLKTR opened this issue Aug 12, 2017 · 2 comments

Comments

@MDSLKTR
Copy link

MDSLKTR commented Aug 12, 2017

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

@MDSLKTR MDSLKTR changed the title changed() function in metaInfo returns Object with metaInfo changed() function in metaInfo returns Object with metaInfo instead of Vue instance Aug 12, 2017
@atinux
Copy link
Member

atinux commented Aug 15, 2017

Hi @MDSLKTR

It's fixed with 1acfa94

I will release 1.1.0 today

@atinux atinux closed this as completed Aug 15, 2017
@MDSLKTR
Copy link
Author

MDSLKTR commented Aug 15, 2017

Hi @atinux,
great to hear! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants