plugin-test.ts 482 B

1234567891011121314151617181920
  1. import Vue from "../index";
  2. import { PluginFunction, PluginObject } from "../index";
  3. class Option {
  4. prefix: string;
  5. suffix: string;
  6. }
  7. const plugin: PluginObject<Option> = {
  8. install(Vue, option) {
  9. if (typeof option !== "undefined") {
  10. const {prefix, suffix} = option;
  11. }
  12. }
  13. }
  14. const installer: PluginFunction<Option> = function(Vue, option) { }
  15. Vue.use(plugin, new Option);
  16. Vue.use(installer, new Option);
  17. Vue.use(installer, new Option, new Option, new Option);