Commit 441da7ecd798f8b51cdefc7d0f5cde54399a4ca3
1 parent
992a6348
添加handle控制允许拖动的元素
Showing
1 changed file
with
2 additions
and
1 deletions
ruoyi-ui/src/views/tool/gen/editTable.vue
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | </el-tab-pane> |
| 7 | 7 | <el-tab-pane label="字段信息" name="cloum"> |
| 8 | 8 | <el-table ref="dragTable" :data="cloumns" row-key="columnId" :max-height="tableHeight"> |
| 9 | - <el-table-column label="序号" type="index" min-width="5%" /> | |
| 9 | + <el-table-column label="序号" type="index" min-width="5%" class-name="allowDrag" /> | |
| 10 | 10 | <el-table-column |
| 11 | 11 | label="字段列名" |
| 12 | 12 | prop="columnName" |
| ... | ... | @@ -203,6 +203,7 @@ export default { |
| 203 | 203 | mounted() { |
| 204 | 204 | const el = this.$refs.dragTable.$el.querySelectorAll(".el-table__body-wrapper > table > tbody")[0]; |
| 205 | 205 | const sortable = Sortable.create(el, { |
| 206 | + handle: ".allowDrag", | |
| 206 | 207 | onEnd: evt => { |
| 207 | 208 | const targetRow = this.cloumns.splice(evt.oldIndex, 1)[0]; |
| 208 | 209 | this.cloumns.splice(evt.newIndex, 0, targetRow); | ... | ... |