在IE11的浏览器预览el-cascader级联组件的时候,选中的选项名显示异常,仿佛没有宽度,具体请看GIF:
自身项目中的element版本是2.4.11,怀疑是版本问题,于是重新载了一个demo,element版本是2.15.6,仍然存在该问题。
使用的代码也是官方的示例,如下:
<template>
<div>
<div class="block">
<span class="demonstration">默认显示所有Tag</span>
<el-cascader
:options="options"
:props="props"
clearable></el-cascader>
</div>
<div class="block">
<span class="demonstration">折叠展示Tag</span>
<el-cascader
:options="options"
:props="props"
collapse-tags
clearable></el-cascader>
</div>
</div>
</template>
<script>
export default {
data() {
return {
props: { multiple: true },
options: [
{
value: 1,
label: "东南",
children: [
{
value: 2,
label: "上海",
children: [
{ value: 3, label: "普陀" },
{ value: 4, label: "黄埔" },
{ value: 5, label: "徐汇" }
]
},
{
value: 7,
label: "江苏",
children: [
{ value: 8, label: "南京" },
{ value: 9, label: "苏州" },
{ value: 10, label: "无锡" }
]
},
{
value: 12,
label: "浙江",
children: [
{ value: 13, label: "杭州" },
{ value: 14, label: "宁波" },
{ value: 15, label: "嘉兴" }
]
}
]
},
{
value: 17,
label: "西北",
children: [
{
value: 18,
label: "陕西",
children: [
{ value: 19, label: "西安" },
{ value: 20, label: "延安" }
]
},
{
value: 21,
label: "新疆维吾尔族自治区",
children: [
{ value: 22, label: "乌鲁木齐" },
{ value: 23, label: "克拉玛依" }
]
}
]
}
]
};
}
};
</script>
想问一下除了手动写死宽度,还有没有什么更好的办法可以解决上述问题?
另外在IE11的浏览器中,级联选框开启多选功能就会自动展开下拉框的问题,也希望有带佬能指点一下该如何解决。
.el-cascader{
.el-tag{
flex: 1 1 auto;
}
}
你写在全局样式文件扒
请问楼主解决了吗