Commit 7024daab authored by baiyaaaaa's avatar baiyaaaaa

add cascader en docs

parent 5c01a654
This diff is collapsed.
...@@ -152,7 +152,9 @@ ...@@ -152,7 +152,9 @@
``` ```
::: :::
### 禁用值 ### 禁用选项
通过在数据源中设置 `disabled` 字段来声明该选项时禁用的
:::demo :::demo
```html ```html
......
...@@ -76,6 +76,10 @@ ...@@ -76,6 +76,10 @@
"path": "/select", "path": "/select",
"title": "Select 选择器" "title": "Select 选择器"
}, },
{
"path": "/cascader",
"title": "Cascader 级联选择"
},
{ {
"path": "/switch", "path": "/switch",
"title": "Switch 开关" "title": "Switch 开关"
...@@ -215,10 +219,6 @@ ...@@ -215,10 +219,6 @@
{ {
"path": "/collapse", "path": "/collapse",
"title": "Collapse 折叠面板" "title": "Collapse 折叠面板"
},
{
"path": "/cascader",
"title": "Cascader 级联选择"
} }
] ]
} }
...@@ -302,6 +302,10 @@ ...@@ -302,6 +302,10 @@
"path": "/select", "path": "/select",
"title": "Select" "title": "Select"
}, },
{
"path": "/cascader",
"title": "Cascader"
},
{ {
"path": "/switch", "path": "/switch",
"title": "Switch" "title": "Switch"
...@@ -441,10 +445,6 @@ ...@@ -441,10 +445,6 @@
{ {
"path": "/collapse", "path": "/collapse",
"title": "Collapse" "title": "Collapse"
},
{
"path": "/cascader",
"title": "Cascader"
} }
] ]
} }
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
<span <span
class="el-cascader" class="el-cascader"
:class="[ :class="[
{ 'is-opened': menuVisible }, {
'is-opened': menuVisible,
'is-disabled': disabled
},
size ? 'el-cascader--' + size : '' size ? 'el-cascader--' + size : ''
]" ]"
@click="menuVisible = !menuVisible" @click="handleClick"
@mouseenter="inputHover = true" @mouseenter="inputHover = true"
@mouseleave="inputHover = false" @mouseleave="inputHover = false"
ref="reference" ref="reference"
...@@ -18,6 +21,7 @@ ...@@ -18,6 +21,7 @@
@change="handleInputChange" @change="handleInputChange"
:validate-event="false" :validate-event="false"
:size="size" :size="size"
:disabled="disabled"
> >
<template slot="icon"> <template slot="icon">
<i <i
...@@ -209,6 +213,11 @@ export default { ...@@ -209,6 +213,11 @@ export default {
}, },
handleClickoutside() { handleClickoutside() {
this.menuVisible = false; this.menuVisible = false;
},
handleClick() {
if (!this.disabled) {
this.menuVisible = !this.menuVisible;
}
} }
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment