GuillaumeLeclerc / vue-google-maps

Google maps component for vue with 2-way data binding
560 stars 653 forks source link

Remove twoWay attributes to all props ? #102

Open AlexandreBonaventure opened 7 years ago

AlexandreBonaventure commented 7 years ago

Hi, first of all thank you for this package, it' good work 👍 . twoWay attributes are here to suggest a good usage for using props. However, it's not required to use props in a twoWay style. I'm using this package along with Vuex, it's generating tons of warnings and it gets a real pain.

Why not removing all twoWay attributes in props definition and let the user decide whether or not to put .sync modifer ? (ex: to draw non-editable marker, etc; ) Moreover, .sync is going to be deprecated.

If the request is approved, I would be glad to submit a PR since I'm already using a custom fork in production.

GuillaumeLeclerc commented 7 years ago

I thought the .sync was supposed to be define by both the component and the user, am I wrong ?

AlexandreBonaventure commented 7 years ago

Actually, it's not like that. The twoWay attribute intent to clarify prop usage for user, by throwing a warning if it is not used with .sync (it's a hint). In all cases it doesn't allow/prevent prop from being used in twoWay/oneWay style (with .sync) http://vuejs.org/guide/components.html#Prop-Validation.