feat: 自定义矩阵列表长度

- MatrixCheckbox 和 MatrixText 可以支持设置宽度
This commit is contained in:
Huangzhe
2025-03-20 15:33:46 +08:00
parent aababb9aaf
commit 1d97fcebe8
2 changed files with 4 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-table :data="rows" style="width: 100%"> <el-table :data="rows" style="width: 100%">
<el-table-column width="140"> <el-table-column :width="tableWidth">
<template #header></template> <template #header></template>
<template #default="{ row /*, column, $index*/ }"> <template #default="{ row /*, column, $index*/ }">
<el-text truncated :style="{ width: `${tableWidth}px` }"> <el-text truncated :style="{ width: `${tableWidth}px` }">
@@ -8,7 +8,7 @@
</el-text> </el-text>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-for="(col, colIndex) in cols" :key="col.option" width="100"> <el-table-column v-for="(col, colIndex) in cols" :key="col.option" :width="tableWidth">
<template #header> <template #header>
<el-text truncated :style="{ width: `${tableWidth}px` }"> <el-text truncated :style="{ width: `${tableWidth}px` }">
<contenteditable v-model="col.option" :active="active" @blur="emitValue" /> <contenteditable v-model="col.option" :active="active" @blur="emitValue" />

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-table :data="rows" style="width: 100%"> <el-table :data="rows" style="width: 100%">
<el-table-column width="140"> <el-table-column :width="tableWidth">
<template #header></template> <template #header></template>
<template #default="{ row /*, column, $index*/ }"> <template #default="{ row /*, column, $index*/ }">
<el-text truncated :style="{ width: `${tableWidth}px` }"> <el-text truncated :style="{ width: `${tableWidth}px` }">
@@ -8,7 +8,7 @@
</el-text> </el-text>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-for="(col, colIndex) in cols" :key="col.option" width="100"> <el-table-column v-for="(col, colIndex) in cols" :key="col.option" :width="tableWidth">
<template #header> <template #header>
<el-text truncated :style="{ width: `${tableWidth}px` }"> <el-text truncated :style="{ width: `${tableWidth}px` }">
<contenteditable <contenteditable