element-ui 使用笔记

1,获取级联选择器 cascader的值

获取value值:就是v-model绑定的值,

获取label值:要先给cascader组件一个ref值,然后通过 this.$refs.组件的ref值.currentLabels 来获取

例子:省市区的级联选择器

参考:http://www.cnblogs.com/shamoyuu/p/element_cascader.html

 

以上的方法el-ui 2.9.2之前的版本有效,2.9.2之后的版本要改成下面的方法:

this.$refs['cascaderAddr'].getCheckedNodes()[0].pathLabels

 

 

2,element-ui 的Dialog被蒙板遮住原因及解决办法

在 el-dialog 标签里添加下面两行代码的任意一行:

 :modal-append-to-body='false'
 或
 :append-to-body='true'

 

参考:https://blog.csdn.net/solocoder/article/details/80936549

 

3,使用DatePicker 日期选择器设置格式

使用format指定输入框的格式;使用value-format指定绑定值的格式。

 

4,使用el-table的时候,想要获取表格对应的行的下标,可以通过scope.$index来获取。

 

posted @ 2019-01-17 15:56  哈哈敲敲  阅读(209)  评论(0编辑  收藏  举报