惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
Recent Announcements
Recent Announcements
D
Docker
V
V2EX
阮一峰的网络日志
阮一峰的网络日志
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
The GitHub Blog
The GitHub Blog
U
Unit 42
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
腾讯CDC
B
Blog
博客园_首页
罗磊的独立博客
D
DataBreaches.Net
IT之家
IT之家
酷 壳 – CoolShell
酷 壳 – CoolShell
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
MongoDB | Blog
MongoDB | Blog
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence

博客园 - Neonuu

解决ollama官方下载过慢的问题(包含windows和linux) 使用java 命令运行包含main方法的class文件时,报 Error: Could not find or load main class Test Java8 list.stream()常用方法 IDEA整合SVN VUE,编辑详情时,列表数据也跟着改变 MySQL面试题 JVM原理 Linux服务器安装MariaDB数据库 jar包解压后,修改完配置文件,再还原成jar包 Java获取resources文件夹下properties配置文件 Java中synchronized,wait(),notify() Java中Runnable和Thread的区别(网上部分说法是错误的) Java中如何实现一个接口拥有多个实现类 JPA中getOne与findOne try catch与spring的事务回滚 Spring主动触发事务回滚 Redis五种数据类型及应用场景 Java面试题 SQL HAVING用法详解 const,var,let区别
VUE二级联动,改变一级下拉框,清空二级下拉框
Neonuu · 2024-08-13 · via 博客园 - Neonuu

在清空二级下拉框时,直接使用this.formData.xxx = '' 会出现清空失败的问题。

使用this.$set(this.formData, 'xxx', '')解决

        <el-form-item label="所属地市" prop="blongId1">
          <el-select v-model="bmixForm.blongId1" placeholder="请选择所属地市" style="width: 300px" @change="getAreaList2">
            <el-option v-for="(item, index) in blongId1List" :key="index" :label="item.NAME"
                       :value="item.ID"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="所属分区" prop="blongId2">
          <el-select v-model="bmixForm.blongId2" placeholder="请选择所属分区" style="width: 300px">
            <el-option v-for="(item, index) in bmixFormBlongId2List" :key="index" :label="item.NAME"
                       :value="item.ID"></el-option>
          </el-select>
        </el-form-item>
    getAreaList2(){
      this.$set(this.bmixForm, 'blongId2', '')
      this.getAreaListByCity2(this.bmixForm.blongId1);
    }