Skip to content

Commit

Permalink
feat: 调整列宽支持设置特定列不可调整
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin-front committed Sep 27, 2019
1 parent 36d26a0 commit 60a3954
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/features/resizable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export default {
width: 100,
fixed: 'left',
sortable: true,
resizable: false
},
{
title: 'Age',
Expand Down
5 changes: 4 additions & 1 deletion src/tableHead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<i @click="handleSort(index, 'asc')" :class="{'on': getColumns(index)._sort === 'asc'}" class="flex-table-arrow-dropup"></i>
<i @click="handleSort(index, 'desc')" :class="{'on': getColumns(index)._sort === 'desc'}" class="flex-table-arrow-dropdown"></i>
</span>
<div v-if="resizable" @mousedown="onColResize($event, index)" class="flex-table-col-resize j-col-resize"></div>
<div v-if="isColResizable(item)" @mousedown="onColResize($event, index)" class="flex-table-col-resize j-col-resize"></div>
</template>
</template>
</div>
Expand Down Expand Up @@ -99,6 +99,9 @@ export default {
});
},
methods: {
isColResizable(col) {
return this.resizable && col.resizable !== false;
},
selectAll() {
const status = !this.isSelectAll;
this.$emit('on-select-all', status);
Expand Down

0 comments on commit 60a3954

Please sign in to comment.