前端UI组件库
npm install web-widget> 前端UI组件库
 
``bash`
npm install --save web-widget
`bash`
yarn add web-widget
bash
npm publish
`示例
`tsx
import React from 'react'
import ReactDOM from 'react-dom'import { Button } from 'web-widget'
const Example: React.FC = () => {
return (
)
}
ReactDOM.render( , document.getElementById('root'))
`按需加载
`javascript
[
'import',
{
libraryName: 'web-widget',
transformToDefaultImport: false,
camel2DashComponentName: false,
customName: (name) => {
const widget = name === 'them'
? name
: name.endsWith('Icon') ? 'icons' : 'components' + /${name}/${name}
return web-widget/dist/es/${widget}
}
},
'web-widget'
]
``Apache-2.0 © Ellite