当前位置: 首页 > news >正文

el-dialog无法关闭

 代码如下,:visible.sync="result2DeptVisible"来控制dialog的隐显问题,但当点击关闭的时候 ,无法关闭!!

<el-dialog :visible.sync="result2DeptVisible" class="el-dialog-view"><el-row slot="title"><el-col>部门查询</el-col><el-row style="margin-top: 30px;" type="flex" justify="space-around"><el-input style="width: 100%;" placeholder="请输入关键字" v-model="inputBelongTo"></el-input></el-row><el-col><el-divider></el-divider></el-col></el-row><el-cascader-panel ref="result2DeptVisibleTypeRef" :options="optionsDept"@change="result2DeptVisibleBtnInterface" :props="optionsDeptMap"><!-- <template slot-scope="{ node, data }"><span>{{ data.deptName }}</span></template> --></el-cascader-panel><el-row type="flex" justify="end"><el-button :disabled="result2DeptDisable" size="mini" style="margin-right: 3px;margin-top: 20px;"type="primary" round icon="el-icon-check" @click="result2DeptTypeOneData">确定</el-button></el-row></el-dialog>

检查了一下data属性如下:

data() {return {// 遮罩层loading: true,// 选中数组ids: [],// 非单个禁用single: true,// 非多个禁用multiple: true,// 显示搜索条件showSearch: true,// 总条数total: 0,// 表格数据dataList: [],// 弹出层标题title: "",// 是否显示弹出层open: false,// 发表年度publicYear: null,inputBelongTo: null,optionsDept: [],// 查询参数queryParams: {pageNum: 1,pageSize: 10,articleName: null,bookName: null,publisherName: null,publicDate: null,isbnumber: null,result2Dept: null,wordsMinNumber: null,wordsMaxNumber: null,authorName: null,},optionsDeptMap: {checkStrictly: false,label: 'deptName',value: 'deptId',children: 'children'},result2DeptDisable: false,flowOptions: [{label: '申请人申请',value: '1'}, {label: '科研管理员审核',value: '2'}, {label: '审核通过',value: '3'}],};},

原来是data中没有定义 result2DeptVisible属性导致的。添加result2DeptVisible:false即可。

 

data() {return {// 遮罩层loading: true,// 选中数组ids: [],// 非单个禁用single: true,// 非多个禁用multiple: true,// 显示搜索条件showSearch: true,// 总条数total: 0,// 表格数据dataList: [],// 弹出层标题title: "",// 是否显示弹出层open: false,// 发表年度publicYear: null,inputBelongTo: null,result2DeptVisible:false,optionsDept: [],// 查询参数queryParams: {pageNum: 1,pageSize: 10,articleName: null,bookName: null,publisherName: null,publicDate: null,isbnumber: null,result2Dept: null,wordsMinNumber: null,wordsMaxNumber: null,authorName: null,},optionsDeptMap: {checkStrictly: false,label: 'deptName',value: 'deptId',children: 'children'},result2DeptDisable: false,flowOptions: [{label: '申请人申请',value: '1'}, {label: '科研管理员审核',value: '2'}, {label: '审核通过',value: '3'}],};},

总结:dom页面上使用的变量尽量按照要求在data中进行定义避免出现一些意外问题去费时排查。

http://www.lryc.cn/news/159707.html

相关文章:

  • MATLAB算法实战应用案例精讲-【大模型】LLM算法(最终篇)
  • Mac brew -v 报错 fatal: detected dubious ownership in repository
  • Docker镜像、容器、仓库及数据管理
  • Java的选择排序、冒泡排序、插入排序
  • Vagrant + VirtualBox + CentOS7 + WindTerm 5分钟搭建本地linux开发环境
  • 关于Ajax
  • 打开转盘锁 -- BFS
  • 国标EHOME视频平台EasyCVR视频融合平台助力地下停车场安全
  • 【业务功能篇96】微服务-springcloud-springboot-认证服务-登录注册功能-Auth2.0-分布式session
  • 自造简易版音频进度条
  • 433MHz芯片在遥控应用市场中的优点
  • 基于Bert+Attention+LSTM智能校园知识图谱问答推荐系统——NLP自然语言处理算法应用(含Python全部工程源码及训练模型)+数据集
  • 慕尼黑主题活动!亚马逊云科技生成式AI全新解决方案,引领未来移动出行领域
  • android 离线语言合成(文字转语音)
  • 使用Fastchat部署vicuna大模型
  • 【2023高教社杯】C题 蔬菜类商品的自动定价与补货决策 问题分析、数学模型及python代码实现
  • 华为云云耀云服务器L实例评测|华为云云耀云服务器L实例评测使用
  • 【DS思想+堆贪心】CF595div3 D2
  • 2023-09-08 LeetCode每日一题(计算列车到站时间)
  • 软考-高级-信息系统项目管理第四版(完整24章全笔记)
  • 华为Mate 60和iPhone 15选哪个?
  • 嵌入式Linux驱动开发(同步与互斥专题)(二)
  • Docker安装部署Nexus3作为内网镜像代理缓存容器镜像
  • SpringBoot工具库:解决SpringBoot2.*版本跨域问题
  • docker安装开发常用软件MySQL,Redis,rabbitMQ
  • C# Unity FSM 状态机
  • pytorch搭建squeezenet网络的整套工程,及其转tensorrt进行cuda加速
  • 【精读Uboot】SPL阶段的board_init_r详细分析
  • canvas绘制渐变色三角形金字塔
  • 企业电子招标采购系统源码Spring Boot + Mybatis + Redis + Layui + 前后端分离 构建企业电子招采平台之立项流程图