@wecode-team/we0-cms 1.0.32 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -243,6 +243,37 @@ interface SchemaField {
|
|
|
243
243
|
maxLength?: number // 最大长度
|
|
244
244
|
defaultValue?: any // 默认值
|
|
245
245
|
relation?: RelationConfig // 关联配置
|
|
246
|
+
editable?: boolean // 是否允许在后台编辑(默认 true;false=不可编辑)
|
|
247
|
+
readOnly?: boolean // 兼容字段:readOnly=true 等价于 editable=false
|
|
248
|
+
}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
#### 字段不可编辑(协议层)
|
|
252
|
+
|
|
253
|
+
当你希望某些字段(如 `created_at`、`updated_at`、`owner_id`、`token`)在后台 **只展示不允许修改** 时,可以在字段上标记:
|
|
254
|
+
|
|
255
|
+
- `editable: false`(推荐)
|
|
256
|
+
- 或 `readOnly: true`(兼容写法)
|
|
257
|
+
|
|
258
|
+
前端行为:
|
|
259
|
+
|
|
260
|
+
- 表单控件会被禁用
|
|
261
|
+
- create/update 提交时会自动跳过该字段(不会传到后端)
|
|
262
|
+
|
|
263
|
+
示例:
|
|
264
|
+
|
|
265
|
+
```js
|
|
266
|
+
{
|
|
267
|
+
name: "created_at",
|
|
268
|
+
type: "datetime",
|
|
269
|
+
comment: "创建时间",
|
|
270
|
+
readOnly: true
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
name: "owner_id",
|
|
274
|
+
type: "string",
|
|
275
|
+
comment: "归属用户",
|
|
276
|
+
editable: false
|
|
246
277
|
}
|
|
247
278
|
```
|
|
248
279
|
|