当前位置:网站首页>el-cascader回显失败;el-cascader回显不出来
el-cascader回显失败;el-cascader回显不出来
2022-07-01 05:07:00 【i_am_a_div_日积月累_】
—我的是省市联动,选择时候是正常的,得到的绑定值是数组 [‘安徽’,‘黄山’],没问题;
但是在详情查看时候,回显成[‘安徽’,‘黄山’],下拉框却不显示回显值。—原因:虽然data里初始化声明变量是数组了,但是在赋值时候必须再次先声明为数组 [ ],然后再赋值。或者是直接数组塞入值。
<el-cascader v-model="shengshi" :options="areaOptions2" placeholder="省市" ></el-cascader>
export default {
data () {
return {
shengshi: [],
}
},
methods: {
getInfo () {
if (res.data.province && res.data.city) {
// el-cascader 回显 要不先定义空数组 然后下标赋值 要不就是直接把值塞入数组
// 直接赋值不行
// this.shengshi[0] = res.data.province
// this.shengshi[1] = res.data.city
// 先声明是数组 再赋值也可以
// this.shengshi = []
// this.shengshi[0] = res.data.province
// this.shengshi[1] = res.data.city
// 直接数组塞入值也可以
this.shengshi = [res.data.province, res.data.city]
} else {
this.shengshi = []
}
}
},
}
边栏推荐
- HCIP Day13
- Solve the problem that the external chain file of Qiankun sub application cannot be obtained
- AssertionError assert I.ndim == 4 and I.shape[1] == 3
- CockroachDB: The Resilient Geo-Distributed SQL Database 论文阅读笔记
- 分布式架构系统拆分原则、需求、微服务拆分步骤
- FileOutPutStream
- FileInputStream
- Use and modification of prior network model
- [summer daily question] Luogu p5886 Hello, 2020!
- LeetCode522-最长特殊序列II-哈希表-字符串-双指针
猜你喜欢

Unity drags and modifies scene camera parameters under the editor

复制宝贝提示材质不能为空,如何解决?
![[hard ten treasures] - 2 [basic knowledge] characteristics of various topological structures of switching power supply](/img/c2/6dfb9f477306edb46ff2a6a6ca32dd.png)
[hard ten treasures] - 2 [basic knowledge] characteristics of various topological structures of switching power supply

Pytoch (I) -- basic grammar

Use and modification of prior network model

Pytorch convolution operation

C WPF uses dockpanel to realize screenshot box

Oracle views the creation time of the tablespace in the database

The longest increasing subsequence and its optimal solution, total animal weight problem

Technology sharing | broadcast function design in integrated dispatching
随机推荐
Leetcode316- remove duplicate letters - stack - greedy - string
Global and Chinese markets of Ethernet communication modules 2022-2028: Research Report on technology, participants, trends, market size and share
积分商城游戏能够给商家带来什么?怎么搭建积分商城?
Copier le matériel de conseils de bébé ne peut pas être vide, comment résoudre?
缓冲流与转换流
工业导电滑环的应用
Print stream and system setout();
How to start learning editing? Detailed analysis of zero basis
Serialization and deserialization of objects
Distributed transactions - Solutions
Is there any good website or software for learning programming? [introduction to programming]?
Global and Chinese market for instant messaging security and compliance solutions 2022-2028: Research Report on technology, participants, trends, market size and share
Global and Chinese markets for business weather forecasting 2022-2028: Research Report on technology, participants, trends, market size and share
Pytoch (IV) -- visual tool visdom
LevelDB源码分析之LRU Cache
Buffer stream and transform stream
Design experience of Meizhou clinical laboratory
AcWing 887. Finding combinatorial number III (Lucas theorem)
Neural network - nonlinear activation
LeetCode_ 35 (search insertion position)
