Advertisement
allnamesweretaken

Untitled

Oct 17th, 2019
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // package
  2. import Vue, { CreateElement } from 'vue'
  3. import { Component } from 'vue-mixin-decorator'
  4.  
  5. @Component
  6. class Vdiv extends Vue {
  7.   render(el: CreateElement) {
  8.     return el(
  9.       'vdiv',
  10.       {
  11.         class: { 'vue-div': true },
  12.         style: { color: '#f00' },
  13.       },
  14.       this.$slots.default,
  15.     )
  16.   }
  17. }
  18.  
  19. export const vdiv = Vdiv
  20.  
  21.  
  22. // app using the package
  23. import Vue from 'vue'
  24. import App from './App.vue'
  25. import router from './router'
  26. import store from './store'
  27. import { vdiv } from '@lbzg/vue-div'
  28.  
  29. Vue.component('vdiv', vdiv)
  30. Vue.config.productionTip = false
  31.  
  32. new Vue({
  33.   router,
  34.   store,
  35.   render: h => h(App),
  36. }).$mount('#app')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement