NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
>功能实现:点击选择本地图片 --wxml-- 默认设置isEmpty为true,当choose后设置为false ``` <image src="{{isEmpty? '/swiper/l1.jpg':imgUrl}}" catchtap="c_click"/> ``` --js-- ``` data: { isEmpty: true }, c_click(){ wx.chooseImage({ count: 9, sizeType: ['original','compressed'], sourceType: ['album','camera'], success: (result)=>{ var tempFilePaths = result.tempFilePaths; this.setData({ imgUrl: tempFilePaths, isEmpty: false }) } }); } ```