vue-interactjs
Version:
interactjs component for Vue
28 lines (21 loc) • 573 B
text/typescript
import getInteractComponent from "@/interact";
import interact from "interactjs";
import { PluginObject, VueConstructor } from "vue";
declare global {
interface Window {
Vue: VueConstructor;
}
}
const version = "__VERSION__";
const install = (Vue: VueConstructor): void => {
const InteractComponent = getInteractComponent(interact);
Vue.component("Interact", InteractComponent);
};
const plugin: PluginObject<VueConstructor> = {
install,
version
};
export default plugin;
if (typeof window !== "undefined" && window.Vue) {
window.Vue.use(plugin);
}