@nutui/nutui
Version:
京东风格的轻量级移动端 Vue2、Vue3 组件库(支持小程序开发)
19 lines (18 loc) • 488 B
JavaScript
import { defineComponent } from "vue";
const camelize = (s) => s.replace(/-./g, (x) => x[1].toUpperCase());
function createComponent(name) {
const componentName = "nut-" + name;
return {
componentName,
create: function(_component) {
_component.name = "Nut" + camelize("-" + name);
_component.install = (vue) => {
vue.component(_component.name, _component);
};
return defineComponent(_component);
}
};
}
export {
createComponent as c
};