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

Throw an Error when methodsName is the same as dataName #115

Closed
everlose opened this issue Aug 29, 2017 · 1 comment
Closed

Throw an Error when methodsName is the same as dataName #115

everlose opened this issue Aug 29, 2017 · 1 comment
Assignees

Comments

@everlose
Copy link

Following code let {{msg}} output function () { return method.apply(instance, arguments); }.
Here is my code

const app = new Moon({
    el: "#app",
    data: {
        msg: "Hello Moon!"
    },
    methods: {
        msg () {
            this.set('msg', 'Moon Hello');
        }
    }
});

I find there has a method that turn methods.msg to data.msg in src/observer/methods.js .

@kbrsh
Copy link
Owner

kbrsh commented Aug 29, 2017

Ahh yes. I will definitely add a warning for this. This is done so methods can be used in templates like:

<p>{{  someMethod(foo)  }}</p>

@kbrsh kbrsh self-assigned this Aug 29, 2017
@kbrsh kbrsh closed this as completed in 191b81d Aug 30, 2017
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