mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-01-12 09:26:56 +08:00
14 lines
309 B
TypeScript
14 lines
309 B
TypeScript
import { App } from 'vue';
|
|
import { camelize } from './format/string';
|
|
|
|
export function installable<T>(options: T) {
|
|
return {
|
|
...options,
|
|
install(app: App) {
|
|
const { name } = options as any;
|
|
app.component(name, options);
|
|
app.component(camelize(`-${name}`), options);
|
|
},
|
|
};
|
|
}
|