Advertisement
allnamesweretaken

index

Oct 19th, 2019
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // main
  2. import Vue, { CreateElement } from 'vue'
  3. import { Component, Mixins } from 'vue-mixin-decorator'
  4. import { VdivConfig, VdivMixins, vdivMixins } from './mixins'
  5.  
  6. export const settings: VdivConfig = {}
  7.  
  8. @Component
  9. class Vdiv extends Mixins<VdivMixins>(Vue, ...vdivMixins) {
  10.   created() {
  11.     this.colorConfig(settings)
  12.   }
  13.   styleMap() {
  14.     return {
  15.       ...this.colorStyles,
  16.     }
  17.   }
  18.   render(el: CreateElement) {
  19.     return el(
  20.       'div',
  21.       {
  22.         class: { 'vue-div': true },
  23.         style: this.styleMap,
  24.       },
  25.       this.$slots.default,
  26.     )
  27.   }
  28. }
  29.  
  30. export default function vdiv(config?: VdivConfig) {
  31.   if (config) Object.assign(settings, config)
  32.   return Vdiv
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement