plugin-test.ts 432 B

12345678910111213141516171819
  1. import Vue = require("../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);