slot-form 自定义参数不会被提交
bugstark opened this issue · 2 comments
bugstark commented
<template>
<el-data-table v-bind="$data">
<template v-slot:form="{row}">
<el-input :value="row ? row.address : '新增场景无数据'" />
</template>
</el-data-table>
</template>
<script>
export default {
data() {
return {
url: 'https://mockapi.eolinker.com/IeZWjzy87c204a1f7030b2a17b00f3776ce0a07a5030a1b/el-data-table?q=basic',
columns: [
{prop: 'date', label: '日期'},
{prop: 'name', label: '姓名'},
{prop: 'address', label: '地址'},
],
form: [
{
type: 'input',
id: 'name',
label: '姓名',
rules: [
{
required: true,
message: '请输入姓名',
trigger: 'blur',
transform: v => v && v.trim()
}
],
el: {placeholder: '请输入姓名'}
},
],
hasView: true
}
}
}
</script>
levy9527 commented
是啊,slot的话,要结合 extraQuery 来实现参数查询。毕竟 slot 太灵活了😂
bugstark commented
用自定义组件实现了,render设计的很灵活,nice