vue-di-view
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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>

Readme

Keywords

none

Package Sidebar

Install

npm i vue-di-view

Weekly Downloads

4

Version

0.1.2

License

none

Unpacked Size

13.7 kB

Total Files

20

Last publish

Collaborators

  • flynnlee123