0👍
You could move all the logic to computed
property:
function getBtnClass () {
let classes = []
if (this.theme === 'primary') classes.push('Bdc(color1)', 'Bdc(color2):h')
...
return classes.join(' ')
}
And pass it to the template: <div class='getBtnClass'>...</div>
- [Vuejs]-How to integrate a external js into the main.js file in Webpack vue.js?
- [Vuejs]-How to show data in Vue tab in devtools?
Source:stackexchange.com