0.0.3 • Published 5 years ago

hyd-ui v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

1: 安装 📦

使用 npm

npm i hyd-ui --save

使用 yarn

yarn add hyd-ui

2: 使用(按需导入) 🔨

  1. 手动引入
import Button from 'hyd-ui/lib/button'; // 加载 JS
import 'hyd-ui/lib/button/style/css'; // 加载 CSS
  1. 利用插件 babel-plugin-import
// .babelrc.js 或加入到webpack.config.js的babel-loader中
module.exports = {
  plugins: [
    ["import", {
      "libraryName": "hyd-ui",
      "libraryDirectory": "es",
      "style": true
    }]
  ]
}

// 项目引入了多个库
module.exports = {
  plugins: [
    ["import", {
      "libraryName": "antd",
      "libraryDirectory": "es",
      "style": true
    }], 
    ["import", {
      "libraryName": "hyd-ui",
      "libraryDirectory": "es",
      "style": true
    },'hyd-ui'], 
  ]
}

3: 使用文档 🌍

doc目录下运行index.html (通过storybook生成,待完善)
目前有2个测试按钮(字体颜色不同):
class Test extends React.Component {
  render(){
    return (
      <Button text="毛衣"></Button>
      <Button1 text="花欠"></Button1>
    )
 }
}

4: 参考文档 🔗