ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
>[success] # image -- 图片 1. [img](https://developers.weixin.qq.com/miniprogram/dev/component/image.html),用法基本可以完全看官方例子就行 2. `image`展示时候元素宽度和高度: **320x240** 3. `/`表示根目录 ~~~ <image src="/assets/zznh.png" mode="aspectFit"/> ~~~ ![](https://img.kancloud.cn/b8/75/b875d690625a9420b2b21696ab55257e_263x147.png) 4. 展示本地图片时候使用`wx.chooseMedia` api ~~~ <button bindtap="onChooseImage">选择图片</button> <image class="img" src="{{chooseImageUrl}}" mode="widthFix"/> ~~~ * index.js ~~~ page({ onChooseImage() { wx.chooseMedia({ mediaType: "image" }).then(res => { const imagePath = res.tempFiles[0].tempFilePath this.setData({ chooseImageUrl: imagePath }) }) }, }) ~~~