I have a html element textarea_01 to which I want to add a style when I press my button_01 which has an onClick function on it
myFunction: function(event) {
//some code that does something
};
Since I can't use directives with JSX I was thinking that the following will work:
<textarea id="textareaID" style={{resetWidth}}/>
And add to my function that's used on the onClick my code, so it will look like:
myFunction: function(event) {
var textarea = new Vue({
el: '#textareaID',
data: {
resetWidth: 'width: 10px'
}
})
//some code that does something
};
But it's not working and WebStorm tells me
You are using the runtime-only build of Vue where the template compiler is not available
How do I work around this and accomplish what I want to do, which is add a css property to a html element after I click on another element ?
Note: Webpack and the followin is used in the code github.com/vuejs/babel-plugin-transform-vue-jsx Note that almost all built-in Vue directives are not supported when using JSX, the sole exception being v-show, which can be used with the v-show={value} syntax.
vue-template-compiler, on just use the compiler version of VueJS. vuejs.org/v2/guide/…