vue-dynamic-component (ru)
Component for fast creating dynamical components.
This component can help for fast migrate from pjax to vue
import vueDynamicComponent from 'vue-dynamic-component'
Vue.use(vueDynamicComponent [, {componentName: 'name-for-component'}])
new Vue({
...
data() {
return {
comp: {
template: '<div>default component with {{msg}} <button @click="msg += \'!\'">add !</button></div>',
data() {
return {msg: 'some text'}
},
}
}
},
...
})
<vue-dynamic-component :component="comp"></vue-dynamic-component>
- required: true
- type: Object
- value
- The standard content component: data, methods, watch, events, etc
- keepAliveId - ID for caching the component by using keep-alive
- required: false
- type: String
- inlineTemplate - Using the template from DOM, like this
- required: false
- type: Boolean
componentName
: changes the name of the component (default name 'vue-dynamic-component'
)