注意 以前1.0时候的iview 只适用vue 1.x 的;
2.0官网:
https://www.iviewui.com/components/cascader
安装
npm install iview@1.0.1 --save 这个是安装1.0的。。。现在vue2.0 了 用不了!
npm install view-design --save 使用这个安装 2.0的。。。
npm WARN notsup Unsupported engine for v-click-outside-x@3.7.1: wanted: {"node":">=8.11.4","npm":"6.4.1"} (current: {"node":"10.15.3","npm":"6.12.0"})
npm WARN notsup Not compatible with your version of node/npm: v-click-outside-x@3.7.1
npm WARN ajv-keywords@3.4.0 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN iview@1.0.1 requires a peer of vue@^1.0.17 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ view-design@4.0.2
added 10 packages from 12 contributors in 11.878s
cascader 之使用
首先 其数据格式要严格按照官网的 label value children;等等 ; 要不然会出错
先写这些 以后再补充;
<Cascader
:data="clients"
trigger="hover"
change-on-select
:not-found-text="conName"
size="small"
@on-change="handleClientChange">
<div style="width: 100%;min-height: 60px; display:inline-flex;flex-direction: row;justify-content:space-between;">
<a style="padding: 13px 13px 0 0;text-align: right;display: inline-block;width: 170px;"href="javascript:void(0)" >选择客户:</a>
</div>
</div>
</Cascader>
友好的一点是添加了插槽。。随便给里面加东西//完美的。 比element ui 更自由;
vue 快要正式使用3.0了。。。最好 最自由的是自己写组件。。弄自己项目需要的,,,,现在项目紧,偷懒下 先用iview 的
good good study dayday up