ik-components
公共组件库
背景:
## 组件开发
组件目录在`src`,下面拿`dialog-api`组件为例:
1. 在`src`新建目录`dialog-api`
2. 在`dialog-api`目录新建`index.js`和`index.vue`(样式文件可自行创建,此处只例举必要条件)
3. `dialog-api/index.vue`撰写组件代码
4. (可选)`dialog-api/index.js`写组件入口,如下:
```jsx'
import Avatar from './index.vue';
Avatar.install = function (Vue) {
Vue.component(Avatar.name, Avatar);
};
export default Avatar;
打包
yarn build
本地开发
yarn dev
单元测试
后续加入
使用
npm 安装 babel-plugin-import
然后通过 npm 安装此组件库后,修改.babelrc
{
...
plugins: [
[
'import',
[
{
"libraryName": "ik-components",
"libraryDirectory": "es",
"style": true
}
]
]
]
...
}
在代码中引用即可
import { avatar } from 'ik-components';
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.0.7 | ^2.6.11 | MIT | |
| 1.0.6 | ^2.6.11 | MIT | |
| 1.0.5 | ^2.6.11 | MIT | |
| 1.0.4 | ^2.6.11 | MIT | |
| 1.0.3 | ^2.6.11 | MIT | |
| 1.0.2 | ^2.6.11 | MIT | |
| 1.0.1 | ^2.6.11 | MIT | |
| 1.0.0 | ^2.6.11 | MIT | |
| 0.2.20 | ^2.6.11 | ||
| 0.2.19 | ^2.6.11 | ||
| 0.2.18 | ^2.6.11 | ||
| 0.2.17 | ^2.6.11 | ||
| 0.2.16 | ^2.6.11 | ||
| 0.2.15 | ^2.6.11 | ||
| 0.2.14 | ^2.6.11 | ||
| 0.2.12 | ^2.6.11 | ||
| 0.2.11 | ^2.6.11 | ||
| 0.2.10 | ^2.6.11 | ||
| 0.2.9 | ^2.6.11 | ||
| 0.2.7 | ^2.6.11 | ||
| 0.2.6 | ^2.6.11 | ||
| 0.2.5 | ^2.6.11 | ||
| 0.2.3 | ^2.6.11 | ||
| 0.2.2 | ^2.6.11 | ||
| 0.1.9 | ^2.6.11 | ||
| 0.1.8 | ^2.6.11 | ||
| 0.1.7 | ^2.6.11 | ||
| 0.1.6 | ^2.6.11 | ||
| 0.1.5 | ^2.6.11 | ||
| 0.1.4 | ^2.6.11 |
Showing the latest 30 of 34. See every release on npm