mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-29 01:39:15 +08:00
fix: failed to install component
This commit is contained in:
parent
5db6e380fe
commit
47ad40794e
@ -1,17 +1,16 @@
|
|||||||
/**
|
/**
|
||||||
* Create a basic component with common options
|
* Create a basic component with common options
|
||||||
*/
|
*/
|
||||||
|
import { camelize } from '../format/string';
|
||||||
// function install(this: any, Vue: VueConstructor) {
|
import type { App, ComponentOptions } from 'vue';
|
||||||
// const { name } = this;
|
|
||||||
// Vue.component(name as string, this);
|
|
||||||
// Vue.component(camelize(`-${name}`), this);
|
|
||||||
// }
|
|
||||||
|
|
||||||
export function createComponent(name: string) {
|
export function createComponent(name: string) {
|
||||||
return function (sfc: any) {
|
return function (sfc: ComponentOptions) {
|
||||||
sfc.name = name;
|
sfc.name = name;
|
||||||
// sfc.install = install;
|
sfc.install = (app: App) => {
|
||||||
|
app.component(name as string, sfc);
|
||||||
|
app.component(camelize(`-${name}`), sfc);
|
||||||
|
};
|
||||||
|
|
||||||
return sfc;
|
return sfc;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user