@fatesigner/vue-lib

2.0.0 • Public • Published

vue-lib

npm download commitizen prettier semantic

Vue组件库.

安装

# 预先安装 vue
npm i -S vue vue-property-decorator
npm i -S @fatesigner/vue-lib

使用

用于动态组件的自定义事件分发

<component :is="comp" v-dynamic-events="{ events: events, listener: listener }" />
import Vue from 'vue';
import { DynamicEvents } from '@fatesigner/vue-lib/directives';

Vue.use(DynamicEvents);

export default {
  data() {
    return {
      comp: import('./component/Comp.vue'),
      // 监听指定事件
      events: ['changed', 'done']
    }
  },
  methods: {
    // 监听动态组件发出的事件
    listener(eventName: string, ...args: any[]) {
      console.log(`${eventName} was triggered.`, args);
    }
  }
};

Package Sidebar

Install

npm i @fatesigner/vue-lib

Weekly Downloads

0

Version

2.0.0

License

MIT

Unpacked Size

33 kB

Total Files

23

Last publish

Collaborators

  • fatesigner