Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address组件无法根据所选择的province,city,country动态加载对应的city,country,town #2676

Open
Astrsea opened this issue Nov 20, 2023 · 2 comments
Labels
PR Welcome 已确认存在的问题,或者计划实现的功能,欢迎社区 PR

Comments

@Astrsea
Copy link

Astrsea commented Nov 20, 2023

NutUI 包名

@nutui/nutui-taro

NutUI 版本号

4.2.1

平台

weapp

重现链接

https://nutui.jd.com/playground/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8bnV0LWNlbGwgdGl0bGU9XCLpgInmi6nlnLDlnYBcIiA6ZGVzYz1cInRleHRcIiBpcy1saW5rIEBjbGljaz1cInNob3dBZGRyZXNzXCI+PC9udXQtY2VsbD5cbiAgPG51dC1hZGRyZXNzXG4gICAgICB2LW1vZGVsPVwidmFsdWVcIlxuICAgICAgOnZpc2libGU9XCJzaG93UG9wdXBcIlxuICAgICAgOnByb3ZpbmNlPVwicHJvdmluY2VzXCJcbiAgICAgIDpjaXR5PVwiY2l0aWVzXCJcbiAgICAgIDpjb3VudHJ5PVwiY291bnRyaWVzXCJcbiAgICAgIDp0b3duPVwidG93bnNcIlxuICAgICAgQGNoYW5nZT1cIm9uQ2hhbmdlXCJcbiAgICAgIEBjbG9zZT1cImNsb3NlXCJcbiAgICAgIEBzZWxlY3Q9XCJzZWxlY3RlZFwiXG4gICAgICBjdXN0b20tYWRkcmVzcy10aXRsZT1cIuivt+mAieaLqeaJgOWcqOWcsOWMulwiXG4gICAgICA6Y29sdW1ucy1wbGFjZWhvbGRlcj1cInBsYWNlaG9sZGVyXCJcbiAgPjwvbnV0LWFkZHJlc3M+XG4gIDxCb3R0b21UYWJiYXI+PC9Cb3R0b21UYWJiYXI+XG48L3RlbXBsYXRlPlxuXG48c2NyaXB0IHNldHVwIGxhbmc9XCJ0c1wiPlxuaW1wb3J0IEJvdHRvbVRhYmJhciBmcm9tIFwiLi4vLi4vY29tcG9uZW50cy9Cb3R0b21UYWJiYXIudnVlXCI7XG5pbXBvcnQgeyByZWYgfSBmcm9tICd2dWUnO1xuaW1wb3J0IHtSZWdpb25EYXRhfSBmcm9tIFwiQG51dHVpL251dHVpLXRhcm8vZGlzdC90eXBlcy9fX1ZVRS9hZGRyZXNzL3R5cGVcIjtcbmNvbnN0IHNob3dQb3B1cCA9IHJlZihmYWxzZSk7XG5sZXQgcHJvdmluY2VzID0gbmV3IEFycmF5PFJlZ2lvbkRhdGE+O1xubGV0IGNpdGllcyA9IG5ldyBBcnJheTxSZWdpb25EYXRhPjtcbmxldCBjb3VudHJpZXMgPSBuZXcgQXJyYXk8UmVnaW9uRGF0YT47XG5sZXQgdG93bnMgPSBuZXcgQXJyYXk8UmVnaW9uRGF0YT47XG5cbmNvbnN0IHRleHQgPSByZWYoJ+WMl+S6rOacnemYs+WMuuWFq+mHjOW6hOihl+mBkycpXG5jb25zdCB2YWx1ZSA9IHJlZihbXSk7XG4gIFxuY29uc3QgZGF0YSA9IFt7XG4gICAgICAgICAgICBjb2RlOiBcIjExMDAwMFwiLFxuICAgICAgICAgICAgY2l0eTogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMTAxMDBcIixcbiAgICAgICAgICAgICAgICAgICAgY291bnRyeTogW1xuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTEwMTAxXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5Lic5Z+O5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMTAxMDJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLopb/ln47ljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjExMDEwNVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIuacnemYs+WMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTEwMTA2XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5Liw5Y+w5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMTAxMDdcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLnn7Pmma/lsbHljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjExMDEwOFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIua1t+a3gOWMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTEwMTA5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi6Zeo5aS05rKf5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMTAxMTFcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLmiL/lsbHljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjExMDExMlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIumAmuW3nuWMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTEwMTEzXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi6aG65LmJ5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMTAxMTRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLmmIzlubPljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjExMDExNVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIuWkp+WFtOWMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTEwMTE2XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5oCA5p+U5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMTAxMTdcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLlubPosLfljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjExMDExOFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIuWvhuS6keWMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTEwMTE5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5bu25bqG5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5biC6L6W5Yy6XCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgdGl0bGU6IFwi5YyX5Lqs5biCXCJcbiAgICAgICAgfSx7XG4gICAgICAgICAgICBjb2RlOiBcIjEyMDAwMFwiLFxuICAgICAgICAgICAgY2l0eTogW1xuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMjAxMDBcIixcbiAgICAgICAgICAgICAgICAgICAgY291bnRyeTogW1xuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTIwMTAxXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5ZKM5bmz5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMjAxMDJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLmsrPkuJzljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjEyMDEwM1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIuays+ilv+WMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTIwMTA0XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5Y2X5byA5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMjAxMDVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLmsrPljJfljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjEyMDEwNlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIue6ouahpeWMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTIwMTEwXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5Lic5Li95Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMjAxMTFcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLopb/pnZLljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjEyMDExMlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIua0peWNl+WMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTIwMTEzXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5YyX6L6w5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMjAxMTRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLmrabmuIXljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjEyMDExNVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIuWuneWdu+WMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTIwMTE2XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5ruo5rW35paw5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogXCIxMjAxMTdcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXCLlroHmsrPljLpcIlxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBcIjEyMDExOFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcIumdmea1t+WMulwiXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IFwiMTIwMTE5XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi6JOf5bee5Yy6XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFwi5biC6L6W5Yy6XCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgdGl0bGU6IFwi5aSp5rSl5biCXCJcbiAgICAgICAgfV07XG5cbmNvbnN0IHNob3dBZGRyZXNzID0gKCkgPT4ge1xuICBzaG93UG9wdXAudmFsdWUgPSAhc2hvd1BvcHVwLnZhbHVlO1xuICBkYXRhLmZvckVhY2goKHByb3ZpbmNlKT0+e1xuICAgIHByb3ZpbmNlcy5wdXNoKHtcbiAgICAgIGlkOnByb3ZpbmNlLmNvZGUsXG4gICAgICBuYW1lOnByb3ZpbmNlLnRpdGxlLFxuICAgICAgY2l0eTpwcm92aW5jZS5jaXR5XG4gICAgfSlcbiAgfSk7XG59O1xuXG5cbmNvbnN0IG9uQ2hhbmdlID0gKGNhbCkgPT4ge1xuICBpZiAoY2FsLm5leHQgPT0gXCJwcm92aW5jZVwiKXtcbiAgICBjYWwudmFsdWUuZm9yRWFjaCgoY2l0eSk9PntcbiAgICAgIGNpdGllcy5wdXNoKHtcbiAgICAgICAgaWQ6Y2l0eS5jb2RlLFxuICAgICAgICBuYW1lOmNpdHkudGl0bGUsXG4gICAgICAgIGNvdW50cnk6Y2l0eS5jb3VudHJ5XG4gICAgICB9KVxuICAgIH0pXG4gICAgaWYgKGNpdGllcy5sZW5ndGggPCAxKXtcbiAgICAgIHNob3dQb3B1cC52YWx1ZSA9IGZhbHNlO1xuICAgIH1cbiAgfWVsc2UgaWYgKGNhbC5uZXh0ID09IFwiY291bnRyeVwiKXtcbiAgICBjYWwudmFsdWUuZm9yRWFjaCgoY291bnRyeSk9PntcbiAgICAgIGNvdW50cmllcy5wdXNoKHtcbiAgICAgICAgaWQ6Y291bnRyeS5jb2RlLFxuICAgICAgICBuYW1lOmNvdW50cnkudGl0bGUsXG4gICAgICB9KVxuICAgIH0pXG4gICAgaWYgKGNvdW50cmllcy5sZW5ndGggPCAxKXtcbiAgICAgIHNob3dQb3B1cC52YWx1ZSA9IGZhbHNlO1xuICAgIH1cbiAgfVxufTtcblxuPC9zY3JpcHQ+XG5cbjxzdHlsZSBsYW5nPVwic2Nzc1wiPlxuPC9zdHlsZT5cblxuXG4ifQ==

重现步骤

###选择省份后,观察市是否动态加载

期望的结果是什么?

选择对应的省后加载省下方对应的市,选择市后动态加载区

实际的结果是什么?

选择省后市无法动态加载,并且出现空值的现象

环境信息

No response

其他补充信息

No response

@xiangBiaoOne
Copy link

这个问题我也遇到了之前版本4.1.6没问题,升级到了4.2.0也出现了这个bug。@change的回掉参数只返回了一个{
"custom": "province"
}.。next和value没有返回,这个bug很严重

@eiinu eiinu self-assigned this Nov 21, 2023
@eiinu eiinu modified the milestone: v4.2.2 Nov 21, 2023
@xiangBiaoOne
Copy link

这个问题虽然解决了,但是不完美。
在选择省的时候,市和区的数组需要一个初始值,给个空数组会选择了省控件就关闭了。
需要这样写:
const address = reactive({
placeholder: placeholder,
province: [{}],
city: [{}],
country: [{}],
town: []
});

@eiinu eiinu removed their assignment Nov 28, 2023
@eiinu eiinu added the PR Welcome 已确认存在的问题,或者计划实现的功能,欢迎社区 PR label Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR Welcome 已确认存在的问题,或者计划实现的功能,欢迎社区 PR
Projects
None yet
Development

No branches or pull requests

3 participants