{ type: "input", label: "运输用时", dataIndex: "transportationTime", vIf: () => { return (form.data.status === 3) }, props: { readonly: () => { return ture } }, }, 这里的输入框只读不好用 怎么办
时间: 2023-12-12 21:02:12 浏览: 34
如果你想让这个输入框只读并且不能被编辑,你可以将 `readonly` 属性设置为 `true`,而不是一个函数。例如:
```
{
type: "input",
label: "运输用时",
dataIndex: "transportationTime",
vIf: () => {
return (form.data.status === 3)
},
props: {
readonly: true
},
}
```
这样,用户将无法编辑此输入框中的文本。如果你想允许用户查看但不允许编辑该输入框,这是一个很好的选择。
相关问题
{ type: "input", label: "运输用时", dataIndex: "transportationTime", vIf: () => { return (form.data.status === 3) }, 让此字段只读不可编辑 },
你可以在表单中的该字段上添加属性 `disabled: true` 来使其只读不可编辑,例如:
```javascript
{
type: "input",
label: "运输用时",
dataIndex: "transportationTime",
vIf: () => {
return form.data.status === 3;
},
disabled: true
}
```
这样用户就不能编辑这个字段了。
v-model:value=" record.controlTypeList.find((obj) => obj.type == column.dataIndex) .control "
这段代码是使用 Vue.js 中的 v-model 指令来绑定一个值。在这个例子中,v-model:value 绑定的值是根据 record.controlTypeList 数组中的元素进行计算得到的。通过 find() 方法,找到 column.dataIndex 属性与 obj.type 相匹配的元素,并获取该元素的 control 属性作为绑定的值。