ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
## 快速上手 ### 引入cview-ui 一般在 webpack 入口页面`main.js`中如下配置: ```javascript import Vue from 'vue' import cview from 'cview-ui' Vue.use(cview) ``` ### 按需引用 >[info] 借助插件[babel-plugin-import](https://github.com/ant-design/babel-plugin-import)可以实现按需加载组件,减少文件体积。首先安装,并在文件`.babelrc`中配置: ``` npm install babel-plugin-import --save-dev ``` ```javascript // .babelrc { "plugins": [ ["import", { "libraryName": "cview-ui", "libraryDirectory": "src/components" } ] ] } ``` 然后这样按需引入组件,就可以减小体积了: ```javascript import { Button, Table, Divider, Col, Row, ButtonGroup } from 'cview-ui' Vue.component('CvuButton', Button); Vue.component('CvuDivider', Divider); Vue.component('CvuCol', Col); Vue.component('CvuRow', Row); Vue.component('CvuButtonGroup', ButtonGroup); Vue.component('CvuTable', Table); ``` ### 使用 按钮 ```html <cvu-button round></cvu-button> ``` 抽屉 ```html <cvu-drawer ref="modal" :title="" :show="" :placement="" :width="" :hide-close="" @on-close="" @on-visible="" > <div>内容</div> </cvu-drawer> ```