pandao / gulp-vue-module

Gulp plugin for Vue.js *.vue component file complie to AMD / CMD / CommonJS module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v-bind:class={'box-default': isDefault} giving error

kurienzach opened this issue · comments

Binding a class attribute in the template like

v-bind:class={'box-default': isDefault} 

produces error
- avoid using JavaScript keyword as property name: "default" in expression :class="{'box-default': isDefault}"

Changing the following line in index.js:155 fixed the issue for me
https://github.com/pandao/gulp-vue-module/blob/master/index.js#L155

contents.template = contents.template.join("").toString().replace(/'/g, "'");

to

contents.template = contents.template.join("").toString().replace(/'/g, "\\'");