小魚(yú)兒心語(yǔ):噴泉之所以漂亮是因?yàn)樗辛藟毫?;瀑布之所以壯觀是因?yàn)樗鼪](méi)有了退路;水之所以能穿石是因?yàn)橛肋h(yuǎn)在堅(jiān)持。人生亦是如此。加油!
通過(guò)el-form和el-table的組合使用,在表格里面添加表單 并且進(jìn)行驗(yàn)證 表單中v-model綁定scope.row中表格的數(shù)據(jù).
<el-form :model="weightcontent" ref="queryRefqz" :inline="true" v-show="showSearch" label-width="68px" style="margin-left: 20px;height: 100%;" @submit.native.prevent>
<el-table v-loading="loading" :data="weightcontent.bznrList" @selection-change="handleSelectionChange" class="tables">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="編號(hào)" align="center" prop="number" width="50"/>
<el-table-column label="標(biāo)準(zhǔn)" align="center" prop="content" width="250">
<template #default="scope">
<span v-html="scope.row.content"></span>
</template>
</el-table-column>
<el-table-column label="標(biāo)準(zhǔn)分值" align="center" prop="total" />
<el-table-column label="權(quán)重" align="center" prop="weight" >
<template #default="scope">
<el-form-item :prop="`bznrList.${scope.$index}.weight`" :rules="{
required: true,
message: '請(qǐng)輸入權(quán)重',
trigger: 'blur',
}">
<el-input
v-model="scope.row.weight"
placeholder="請(qǐng)輸入權(quán)重"
clearable
@blur.stop="$event => editSave(scope.row)"
>
</el-input>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>