0.1.2 • Published 5 years ago
vue-di-view v0.1.2
vue-di-view
inject view from child to parent useful when ui is in parent component but logic in child component
npm install vue-di-view
import Vue from 'vue'
import VueDiView from 'vue-di-view'
Vue.use(VueDiView)
use
parent.vue
<div>
<!-- create a view placeholder then child component can inject here -->
<di-view name='test'>
</div>
child.vue
<div>
<!-- di-child's children view will render to previous <di-view> placeholder -->
<div v-di-view="{name:'test'}">
Hello world
</div>
</div>