-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4c95ad
commit c25e5b3
Showing
5 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
## 获取组件内的el-table实例 | ||
|
||
```html | ||
<el-data-table | ||
ref="dataTable" | ||
v-bind="tableConfig" | ||
></el-data-table> | ||
``` | ||
|
||
```javascript | ||
this.$refs.dataTable.$refs.table | ||
``` | ||
|
||
|
||
## 手动调用el-data-table刷新 | ||
|
||
```javascript | ||
this.$refs.dataTable.getList() | ||
``` | ||
|
||
## 查询后刷新 | ||
|
||
### 场景 | ||
<br /> | ||
|
||
### 解决方案 | ||
把select option的value变成字符串类型 | ||
|
||
### 原有代码 | ||
|
||
```javascript | ||
searchForm: [ | ||
{ | ||
$el: {placeholder: '请选择'}, | ||
label: '状态', | ||
$id: 'status', | ||
$type: 'select', | ||
$options: [ | ||
{ | ||
value: 1, | ||
label: '待处理' | ||
}, | ||
] | ||
} | ||
], | ||
``` | ||
|
||
|
||
### 改动后代码 | ||
|
||
```javascript | ||
searchForm: [ | ||
{ | ||
$el: {placeholder: '请选择'}, | ||
label: '状态', | ||
$id: 'status', | ||
$type: 'select', | ||
$options: [ | ||
{ | ||
value: '1', // 修改了这一行 | ||
label: '待处理' | ||
}, | ||
] | ||
} | ||
], | ||
``` | ||
|
||
## 弹窗关闭时清空选中状态 | ||
|
||
|
||
### 场景 | ||
el-data-table 在 el-dialog 中展示,在 el-dialog 关闭后,清空 el-data-table 的选中状态。 | ||
|
||
|
||
### 解决方案 | ||
 | ||
|
||
```javascript | ||
cancelRelation() { | ||
this.showRelationDialog = false | ||
this.selected = [] | ||
this.$refs.outsideModuleTable.$refs.table.clearSelection() | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters