-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathentry.esm.ts
25 lines (20 loc) · 1017 Bytes
/
entry.esm.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { App, DefineComponent, Plugin } from 'vue';
// Import vue component
import component from '@/vue3-slider.vue';
// Define typescript interfaces for installable component
type InstallableComponent = DefineComponent & { install: Exclude<Plugin['install'], undefined> };
// Default export is installable instance of component.
// IIFE injects install function into component, allowing component
// to be registered via Vue.use() as well as Vue.component(),
export default /*#__PURE__*/((): InstallableComponent => {
// Assign InstallableComponent type
const installable = component as unknown as InstallableComponent;
// Attach install function executed by Vue.use()
installable.install = (app: App) => {
app.component('Vue3Slider', installable);
};
return installable;
})();
// It's possible to expose named exports when writing components that can
// also be used as directives, etc. - eg. import { RollupDemoDirective } from 'rollup-demo';
// export const RollupDemoDirective = directive;