vue2/types/test/plugin-test.ts

20 lines
433 B
TypeScript
Raw Normal View History

2016-09-06 21:28:17 +08:00
import Vue = require("../index");
import { PluginFunction, PluginObject } from "../plugin";
class Option {
prefix: string;
suffix: string;
}
const plugin: PluginObject<Option> = {
install(Vue, option) {
if (typeof option !== "undefined") {
const {prefix, suffix} = option;
}
}
}
const installer: PluginFunction<Option> = function(Vue, option) { }
Vue.use(plugin, new Option);
Vue.use(installer, new Option);