vuejs / vue-template-es2015-compiler

Support a subset of handy ES2015 features in Vue 2.0 templates.
61 stars 23 forks source link

fix object destructuring with custom variable name #7

Closed preaction closed 7 years ago

preaction commented 7 years ago

When doing object destructuring with a custom variable name ({ obj_prop: var_name }), we get an error: The generated code contains var _vm.var_name = ref.obj_prop which is invalid syntax. So we need to skip overwriting to add a _vm. to the variable name.

Fixes #6

yyx990803 commented 7 years ago

Thanks!