1.0.6 • Published 6 months ago
@web-xhh/web-components v1.0.6
Description
web前端通用组件库(测试中项目)
Install
npm i @web-xhh/web-components -S
Usage
全局引入
import webComponents from '@web-xhh/web-components'
import '@web-xhh/web-components/lib/style.css'
Vue.use(webComponents)
<XhhButton button-type="warning">按钮测试</XhhButton>
按需引入
import XhhButton from '@web-xhh/web-components/lib/xhh-button'
import '@web-xhh/web-components/lib/xhh-button/style.css'
Vue.use(XhhButton)
<XhhButton button-type="warning">按钮测试</XhhButton>
按需引入优化
使用babel-plugin-component
"plugins": [
[
"component",
{
"libraryName": "@web-xhh/web-components",
"style": true
}
]
]
import { XhhButton, XhhToast } from '@web-xhh/web-components'
Vue.use(XhhButton)
Vue.use(XhhToast)
<XhhButton button-type="warning">按钮测试咯</XhhButton>
<XhhToast />