Skip to content

update readme for caveats of class properties #69

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

Merged
merged 3 commits into from
Mar 2, 2017
Merged

Conversation

ktsn
Copy link
Member

@ktsn ktsn commented Mar 1, 2017

As pointed out on #67, we may need to mention about caveats of class property definition. I've added it in docs on this PR.

README.md Outdated
}
```

You can simply define a method instead of a class property in that case:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not standard JavaScript pattern. It only works in Vue because the library binds it. It might be good to point this out in case readers do not know it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. Fixed 🙂

README.md Outdated
@@ -159,6 +159,39 @@ new Vue({
})
```

### Caveats of Class Properties

vue-class-component corrects class properties as Vue instance data by instantiating the original constructor under the hood. While we can define instance data like native class manner, we sometimes need to know how it works.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

collects?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes.

@ktsn ktsn merged commit 34ef0ce into master Mar 2, 2017
@ktsn ktsn deleted the docs-property branch March 2, 2017 15:46
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

Successfully merging this pull request may close these issues.

2 participants