Files
vxe-table/examples/views/table/base/Fixed.vue
xuliangzhan c1ca7393ba update
2019-05-16 14:36:44 +08:00

46 lines
1.5 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<p>当横向内容过多时将列固定在左右两侧</p>
<vxe-table
border
show-all-overflow
:data.sync="tableData">
<vxe-table-column type="index" width="60" fixed="left"></vxe-table-column>
<vxe-table-column prop="name" label="Name" width="300"></vxe-table-column>
<vxe-table-column prop="role" label="Role" width="300"></vxe-table-column>
<vxe-table-column prop="sex" label="Sex" width="300"></vxe-table-column>
<vxe-table-column prop="date" label="Date" width="300"></vxe-table-column>
<vxe-table-column prop="address" label="Address" fixed="right" width="300"></vxe-table-column>
</vxe-table>
<p>如果列宽足够的情况下固定列不会浮动</p>
<vxe-table
border
show-all-overflow
:data.sync="tableData">
<vxe-table-column type="index" width="60" fixed="left"></vxe-table-column>
<vxe-table-column prop="name" label="Name"></vxe-table-column>
<vxe-table-column prop="role" label="Role"></vxe-table-column>
<vxe-table-column prop="sex" label="Sex"></vxe-table-column>
<vxe-table-column prop="age" label="Age"></vxe-table-column>
<vxe-table-column prop="address" label="Address" fixed="right" width="300"></vxe-table-column>
</vxe-table>
</div>
</template>
<script>
export default {
data () {
return {
tableData: []
}
},
created () {
let list = window.MOCK_DATA_LIST.slice(0, 4)
this.tableData = list
}
}
</script>