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

城市选择器,ColPicker 组件 再次赋值的问题。 #357

Closed
55555778 opened this issue Jun 7, 2024 · 6 comments
Closed

城市选择器,ColPicker 组件 再次赋值的问题。 #357

55555778 opened this issue Jun 7, 2024 · 6 comments
Assignees
Labels

Comments

@55555778
Copy link

55555778 commented Jun 7, 2024

Wot Design Uni 版本号

1.2.21

平台

微信小程序

复现Demo地址

https://github.com/55555778/wot

重现步骤

<script setup lang="ts"> import areaData from '../../utils/area.json' import { ref, onMounted } from 'vue' const value = ref([]) const area = ref(areaData) const columnChange1 = ({ selectedItem, resolve, finish, index, rowIndex }) => { const value = index === -1 ? 86 : selectedItem.value if (areaData[value]) { resolve( Object.keys(areaData[value]).map((key) => { return { value: key, label: areaData[value][key], } }) ) } else { finish() } } function handleConfirm({ value }) { console.log(value.value) } onMounted(() => { console.log('area :>> ', area.value) value.value = ['150000', '150100', '150121'] }) </script> <style scoped></style>

期望的结果是什么?

再次赋值 仍然被检测的到;
大多数情况下,非首次选择,需要向后端请求数据,并且回显到组件中。

实际的结果是什么?

再次赋值三个地址编号,只回显了 第一个城市。
image

环境信息

No response

其他补充信息

No response

@55555778 55555778 added the 🐞bug: need confirm 待确认的bug label Jun 7, 2024
@Moonofweisheng Moonofweisheng self-assigned this Jun 9, 2024
@sand1018
Copy link

同样的问题,加上 auto-complete 也无效

@Moonofweisheng
Copy link
Owner

同样的问题,加上 auto-complete 也无效

你可以试试先在接口返回数据之前不渲染这个,这个问题大概率是常见问题中所链接的2个issue带来的。

@sand1018
Copy link

同样的问题,加上 auto-complete 也无效

你可以试试先在接口返回数据之前不渲染这个,这个问题大概率是常见问题中所链接的2个issue带来的。

我在组件上加 v-if 等数据加载回来后再显示,他还是没有触发 column-change 事件

@Moonofweisheng Moonofweisheng added 🐞bug bug and removed 🐞bug: need confirm 待确认的bug labels Jul 2, 2024
@Moonofweisheng
Copy link
Owner

Moonofweisheng commented Jul 8, 2024

同样的问题,加上 auto-complete 也无效

你可以试试先在接口返回数据之前不渲染这个,这个问题大概率是常见问题中所链接的2个issue带来的。

我在组件上加 v-if 等数据加载回来后再显示,他还是没有触发 column-change 事件

可以参考最新的文档实现异步加载,如果还有问题可以重新开一个
issue

@ZSX-JOJO
Copy link

目前这个问题我也遇到了,请问你们是怎么解决的?

@55555778
Copy link
Author

目前这个问题我也遇到了,请问你们是怎么解决的?

当数据加载完成之后渲染。 价格v-if 去判断一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants