🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
>[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 }) }) }, }) ~~~