feat: 自定义矩阵列表长度
- 添加 tableWidth 来设定矩阵列表宽度, 默认110
This commit is contained in:
@@ -3,14 +3,14 @@
|
||||
<el-table-column width="140">
|
||||
<template #header></template>
|
||||
<template #default="{ row /*, column, $index*/ }">
|
||||
<el-text truncated>
|
||||
<el-text truncated :style="{ width: `${tableWidth}px` }">
|
||||
<contenteditable v-model="row.option" :active="active" @blur="emitValue" />
|
||||
</el-text>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-for="(col, colIndex) in cols" :key="col.option" width="100">
|
||||
<template #header>
|
||||
<el-text truncated>
|
||||
<el-text truncated :style="{ width: `${tableWidth}px` }">
|
||||
<contenteditable
|
||||
v-if="col.option"
|
||||
v-model="col.option"
|
||||
@@ -23,6 +23,7 @@
|
||||
<template #default="{ /*row, column, */ $index: rowIndex }">
|
||||
<input
|
||||
type="text"
|
||||
style="width: 100%"
|
||||
:name="`R${rowIndex + 1}`"
|
||||
:value="getInputValue(rowIndex, colIndex)"
|
||||
@change="handleMatrixTextChange(rowIndex, colIndex, $event)"
|
||||
@@ -48,6 +49,7 @@ const element = defineModel<question>('element', {
|
||||
/* const isPreview = */ defineModel<boolean>('isPreview', { required: false, default: false });
|
||||
const rows = defineModel<questionOptionType[]>('rows', { required: false, default: () => [] });
|
||||
const cols = defineModel<questionOptionType[]>('cols', { required: false, default: () => [] });
|
||||
const tableWidth = defineModel<number>('tableWidth', { required: false, default: 110 });
|
||||
|
||||
const emit = defineEmits(['update:matrixAnswer', 'update:rowRecord', 'update:element']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user