#6089·vant-weapp

Filed 无法显示值

作者: mynameiscuining创建于 2026年9月12日更新于 2026年9月12日
标签bug: need confirm

const userInfo = ref<WxMiniUserInfo>({}) const nickname = ref('123123123') const avatarUrl = ref('') const profileList = ref<WxMiniProfileFile[]>([]) const uploading = ref(false) const saving = ref(false) const normalizeAvatarUrl = (url?: string) => /^(https?:\/\/|wxfile:\/\/|cloud:\/\/|data:image\/|\/)/i.test(url?.trim() || '') ? url!.trim() : '' // Vant Weapp's field value is returned from change.detail.value, use value to pass to the Weapp component in one direction. const handleNicknameChange = (event: { detail?: { value?: string } | string } | string) => { const detail = typeof event === 'string' ? event : event.detail const nickname = typeof detail === 'string' ? detail : (detail?.value || '') } onLoad(() => { // The edit page is initialized from the local cache, ensuring that the displayed information is consistent with the current cache information in the personal center. userInfo.value = getCachedUserInfo<WxMiniUserInfo>() || {} profileList.value = userInfo.value.profileList || [] nickname.value = userInfo.value.nickName || '' })

内容来源: youzan/vant-weapp