Giter Site home page Giter Site logo

俩个下拉框实现联动效果 about amis HOT 4 OPEN

coffin03 avatar coffin03 commented on July 19, 2024
俩个下拉框实现联动效果

from amis.

Comments (4)

2betop avatar 2betop commented on July 19, 2024

表单项配置 strickMode: false

另外可以这个场景其实可以直接用这个机制 https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/linkage#%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8

from amis.

coffin03 avatar coffin03 commented on July 19, 2024

表单项配置 strickMode: false

另外可以这个场景其实可以直接用这个机制 https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/linkage#%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8

{
"type": "form",
"body": [
{
"type": "select",
"label": "选项1",
"name": "select1",
"options": [
{
"label": "选项A",
"value": "A"
},
{
"label": "选项B",
"value": "B"
}
],
"id": "u:7fd35fab406e",
"multiple": false,
"onEvent": {
"change": {
"weight": 0,
"actions": [
{
"componentId": "u:3f3bf5be7036",
"ignoreError": false,
"actionType": "reload"
}
]
}
},
"strictMode": false
},
{
"type": "select",
"label": "选项2",
"name": "select2",
"id": "u:3f3bf5be7036",
"multiple": false,
"source": {
"url": "http://dnn1a1cvipdt",
"method": "post",
"data": {
"name": "${select1}"
}
},
"labelField": "name",
"valueField": "id",
"strictMode": false
}
],
"id": "u:68ad3b4c6589",
"actions": [
{
"type": "submit",
"label": "提交",
"primary": true,
"id": "u:dc795c3d4eee"
}
],
"feat": "Insert"
}

加了strictMode 没用

from amis.

coffin03 avatar coffin03 commented on July 19, 2024

表单项配置 strickMode: false
另外可以这个场景其实可以直接用这个机制 https://aisuda.bce.baidu.com/amis/zh-CN/docs/concepts/linkage#%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8

{ "type": "form", "body": [ { "type": "select", "label": "选项1", "name": "select1", "options": [ { "label": "选项A", "value": "A" }, { "label": "选项B", "value": "B" } ], "id": "u:7fd35fab406e", "multiple": false, "onEvent": { "change": { "weight": 0, "actions": [ { "componentId": "u:3f3bf5be7036", "ignoreError": false, "actionType": "reload" } ] } }, "strictMode": false }, { "type": "select", "label": "选项2", "name": "select2", "id": "u:3f3bf5be7036", "multiple": false, "source": { "url": "http://dnn1a1cvipdt", "method": "post", "data": { "name": "${select1}" } }, "labelField": "name", "valueField": "id", "strictMode": false } ], "id": "u:68ad3b4c6589", "actions": [ { "type": "submit", "label": "提交", "primary": true, "id": "u:dc795c3d4eee" } ], "feat": "Insert" }

加了strictMode 没用

现在的应用场景是只使用编辑器的可视化面板进行配置 能不能用可视化面板在不更改源码的情况下实现这一需求

from amis.

coffin03 avatar coffin03 commented on July 19, 2024

在chang 里加了 debounce防抖就可以拿到最新的值了

from amis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.