0👍
I can’t imagine why you would want to be do that but anyhow you could do the following
Vue.component('search', {
name: 'search',
template: `<div :class="wrapperClass">
<div>component template</div>
</div>`,
computed: {
componentName() {
return this.$options.name
},
wrapperClass() {
return `component-${this.componentName}`
},
}
})
- [Vuejs]-How to call api when change value in vue multiselect
- [Vuejs]-Vue watcher's first callback not ordered "correctly" on post-instantiation watchers
Source:stackexchange.com