baidu / baidu/amis

地址栏携带的参数,无法自动填充到组件里面

Open
#8,450 6 comments 0 reactions 1 assignee Claimed by @2betop View on GitHub
need confirm style
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

地址栏携带的参数,无法自动填充到组件里面

#### 截图或视频:

![image](https://github.com/baidu/amis/assets/33440486/f7716e69-7731-4f13-aa78-4b7d34cbf7d9)

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

1. 你是如何使用 amis 的?
使用sdk的方式引入 3.4.3版本

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

3.4.0 这个版本还不存在这个问题,从3.4.2就存在这个问题了

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

AMIS_JSON={
"type": "page",
"definitions":{
"jsonForm":{
"title": "json-${name}",
"size": "full",
"body": {
"type": "form",
"initApi": "/admin/form/getJson?id=${id}",
"api": "/admin/form/saveJson",
"actions":[],
"body": [
{
"type": "editor",
"name": "json",
"size":"xxl",
"language": "json",
"disabled": false,
"allowFullscreen":true
}
]
}
}
},
"body": {
"type": "crud",
"api": "post:/admin/form/query",
"syncLocation": false,
"filterTogglable": false,
"affixHeader":true,
"autoFillHeight": true,
"headerToolbar": [
"filter-toggler",{
"label": "新增",
"type": "button",
"primary": true,
"actionType": "dialog",
"dialog": {
"title":"新增",
"size":"full",
"body":{
"type":"iframe",
"src":"/admin/page/formEdit.html",
"height":"calc( 100% - 10px )"
},
"actions":[]
}
},
{
"type": "button",
"actionType": "dialog",
"label": "JSON新增",
"size":"sm",
"icon": "fa fa-plus pull-left",
"primary": true,
"dialog":{
"$ref":"jsonForm"
}
}
],
"filter": {
"title":["表单管理"
/*,{
"type":"button",
"label":"刷新页面",
"actionType": "url",
"url":"",
"blank":false,
"level":"secondary",
"className":"m-l float-right relative jqp-top-btn"
}*/],
"submitText": "",
"mode": "horizontal",
"body": [
{
"type":"grid",
"columns":[{
"type": "input-text",
"name": "code",
"label":"编号"
},
{
"type": "input-text",
"name": "name",
"label":"名称"
},{
"label": "查询",
"primary":true,
"type": "submit"
}]
}
]
},
"columns": [
{
"name": "code",
"label": "编号"
},
{
"name": "name",
"label": "名称"
},
{
"name": "tableName",
"label": "表"
},
{
"name": "js",
"label": "js脚本"
},
{
"type": "operation",
"label": "操作",
"buttons": [
{
"label": "编辑",
"type": "button",
"actionType": "dialog",
"dialog": {
"title":"编辑-${name}",
"size":"full",
"body":{
"type":"iframe",
"src":"/admin/page/formEdit.html?id=${id}",
"height":"calc( 100% - 10px )"
},
"actions":[]
}
},{
"label": "复制",
"type": "button",
"actionType": "dialog",
"dialog": {
"title":"复制-${name}",
"size":"full",
"body":{
"type":"iframe",
"src":"/admin/page/formEdit.html?id=${id}&type=copy",
"height":"calc( 100% - 10px )"
},
"actions":[]
}
},{
"label": "预览",
"type": "button",
"actionType": "url",
"url":"/form/${code}"
},{
"label": "预览js",
"type": "button",
"actionType": "url",
"url":"/admin/form/js/${code}.js"
},{
"type": "button",
"level":"danger",
"actionType": "ajax",
"label": "删除",
"confirmText": "您确认要删除${name}?",
"api": "/admin/common/form/delete/${id}"
},{
"label": "编辑JSON",
"type": "button",
"actionType": "dialog",
"dialog": {
"$ref":"jsonForm"
}
}
]
}
/*,{
"type":"each",
"label":"循环",
"name":"buttons",
"className":"antd-OperationField",
"items":{
"type":"button",
"size":"sm",
"label":"${name}",
"actionType": "ajax",
"api":"/xxxx.xxx"
}
}
*/
]
}
}

```

4. 操作步骤
浏览器访问此页面,携带 参数 ?code=test ,crud的查询表单里面名称为code的input无法带入此参数

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.