编译中的小问题

This commit is contained in:
Xu Chang 2022-05-31 11:56:34 +08:00
parent 7869e4128a
commit fc04f65555
3 changed files with 4 additions and 4 deletions

View File

@ -158,8 +158,8 @@ OakComponent({
async onItemTapped(event: WechatMiniprogram.Touch) {
const { files } = this.data;
const { index } = event.currentTarget.dataset;
const imageUrl = composeFileUrl(files[index]);
const urls = files?.map((ele) => composeFileUrl(ele));
const imageUrl = composeFileUrl(files[index]!);
const urls = files?.filter(ele => !!ele).map((ele) => composeFileUrl(ele!));
const detail = {
all: files,

View File

@ -28,7 +28,7 @@ OakPage({
methods: {
onItemClicked(options: WechatMiniprogram.Touch) {
const item = (this.data.arealist!).find(
(ele) => ele.id === options.currentTarget.dataset.id
(ele) => ele?.id === options.currentTarget.dataset.id
);
const { depth, id } = item!;

View File

@ -40,7 +40,7 @@ OakPage({
formData: async ({ data: users }) => {
const userData = users.map(
(user) => {
const { id, nickname, userState, name, mobile$user, extraFile$entity } = user;
const { id, nickname, userState, name, mobile$user, extraFile$entity } = user || {};
const mobile = mobile$user && mobile$user[0]?.mobile;
const avatar = extraFile$entity && extraFile$entity[0] && composeFileUrl(extraFile$entity[0]);
return {