baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.33k stars 2.51k forks source link

Vue3中渲染amis的CRUD控件时,点击《新增》按钮报错! #6511

Closed citynook closed 1 year ago

citynook commented 1 year ago

描述问题:

在Vue3中用 amis.render 渲染了 CRUD 组件,在点击《新增》按钮时报错。在amis-editor编辑窗口中预览的时候是正常的。

截图或视频:

image

点击《新增》按钮后报错: image TypeError: 'get' on proxy: property 'body' is a read-only and non-configurable data property on the proxy target but the proxy did not return its actual value (expected '#' but got '#')

in CRUDRenderer (created by WithStore(CRUDRenderer))
in WithStore(CRUDRenderer) (created by Scoped(WithStore(CRUDRenderer)))
in Scoped(WithStore(CRUDRenderer)) (created by Renderer)
in Renderer (created by PageRenderer)
in div (created by PageRenderer)
in div (created by PageRenderer)
in div (created by PageRenderer)
in div (created by PageRenderer)
in PageRenderer (created by WithStore(PageRenderer))
in WithStore(PageRenderer) (created by Scoped(WithStore(PageRenderer)))
in Scoped(WithStore(PageRenderer)) (created by Renderer)
in Renderer (created by RootRenderer2)
in RootRenderer2 (created by Root2)
in ImageGallery2 (created by I18N(ImageGallery2))
in I18N(ImageGallery2) (created by Themeable(I18N(ImageGallery2)))
in Themeable(I18N(ImageGallery2)) (created by Root2)
in Root2 (created by Scoped(Root2))
in Scoped(Root2)

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的? sdknpm其他...

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在

  3. 粘贴有问题的完整 amis schema 代码:

AmisRenderer.vue

页面的Schema: { "type": "page", "title": "新页面", "body": [ { "type": "crud", "syncLocation": false, "api": { "method": "get", "url": "/studio/page/list", "type": "crud", "syncLocation": false, "api": "/studio/page/list", "columns": [ { "name": "id", "label": "ID", "type": "text", "id": "u:5fc7824c39da" }, { "name": "pageCode", "label": "页面代码", "type": "text", "id": "u:40c113740e23" }, { "type": "text", "label": "页面名称", "name": "pageName", "id": "u:9dddb4c5886e" } ], "bulkActions": [ ], "itemActions": [ ], "messages": { }, "responseData": { "items": "${result.records}", "total": "${result.total}" }, "id": "u:112733bef88b" }, "columns": [ { "name": "id", "label": "ID", "type": "text", "id": "u:d9807ddb319c" }, { "type": "text", "label": "页面代码", "name": "pageCode", "id": "u:d87a7e28e95f" }, { "type": "text", "label": "页面名称", "name": "pageName", "id": "u:a713ae56c98a" } ], "bulkActions": [ ], "itemActions": [ ], "id": "u:5d0ba59714b8", "features": [ ], "headerToolbar": [ { "label": "新增", "type": "button", "actionType": "dialog", "level": "primary", "dialog": { "title": "新增", "body": { "type": "form", "api": { "method": "post", "url": "/studio/page/list", "type": "crud", "syncLocation": false, "api": "/studio/page/list", "columns": [ { "name": "id", "label": "ID", "type": "text", "id": "u:5fc7824c39da" }, { "name": "pageCode", "label": "页面代码", "type": "text", "id": "u:40c113740e23" }, { "type": "text", "label": "页面名称", "name": "pageName", "id": "u:9dddb4c5886e" } ], "bulkActions": [ ], "itemActions": [ ], "messages": { }, "responseData": { "items": "${result.records}", "total": "${result.total}" }, "id": "u:112733bef88b" }, "body": [ { "type": "input-text", "name": "id", "label": "ID" }, { "type": "input-text", "name": "pageCode", "label": "页面代码" }, { "type": "input-text", "name": "pageName", "label": "页面名称" } ] } }, "id": "u:4ec57de1e878" }, "bulkActions" ] } ], "asideResizor": false, "regions": [ "body" ], "id": "u:f48152ef4b8e", "style": { "boxShadow": " 0px 0px 0px 0px transparent" }, "pullRefresh": { "disabled": true } }

  1. 操作步骤 用 AmisRender.vue 渲染界面后,点击《新增》按钮报错。
github-actions[bot] commented 1 year ago

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

citynook commented 1 year ago

在原始项目上重新安装Amis及相关的包后,问题消失,不清楚是什么原因。