// 安装
npm i common-tool1
// 引用
import { http, util, directive } from 'common-tool1'
// 使用
1. 网络请求
// 只传baseURL
const baseURl = ''
const {commonApi, uploadApi, formApi} = http.quickCreateService(baseURl, {handleRequest, handleResponse, handleError})
// 自定义其它配置项,但是baseURL必须传
const options = { // axios的其它配置
baseURl,
...
}
const {commonApi, uploadApi, formApi} = http.quickCreateService(options, {handleRequest, handleResponse, handleError})
commonApi.get('/url/...', {name: ''}) // 示例
commonApi.post('/url/...', {name: ''})
2. el-select 扩展指令
<el-select
multiple
v-uncandelete="[name]"
v-ondelete="callback"
...
>
<el-option
...
</el-option>
</el-select>
3. 获取css变量的渲染颜色值
this.bigdataosfont2 = util.getColorFromCss("--bigdataos-font-2");