UNPKG

@ray-js/smart-ui

Version:

轻量、可靠的智能小程序 UI 组件库

15 lines (14 loc) 481 B
function kebabCase(srt) { const t = srt.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`); if (t[0] === '-') { return t.slice(1); } return t; } const SmartUIAutoImport = { libraryName: '@ray-js/smart-ui', format(localName, importedName) { return `import { ${importedName !== localName ? `${importedName} as ${localName}` : localName} } from "@ray-js/smart-ui/es/${kebabCase(importedName)}";`; }, }; export default SmartUIAutoImport;