文档链接:https://uniapp.dcloud.net.cn/component/uniui/uni-file-picker.html#value-%E6%A0%BC%E5%BC%8F
我正在学习uniapp开发,使用上面文档链接的代码时图片未显示,如图只显示了标题,图片未显示,后来将":value"改为“v-model”后才正常显示,这是什么原因,":value"还有用吗?
<uni-section title="自定义图片大小" type="line">
<view class="example-body ">
<uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
</uni-file-picker>
<uni-file-picker readonly :value="fileLists" :listStyles="listStyles" file-mediatype="all">
</uni-file-picker>
</view>
</uni-section>
<script>
export default {
data() {
return {
// ...
fileLists: [{
url: 'https://images.weserv.nl/?url=https://web-assets.dcloud.net.cn/unidoc/zh/shuijiao-small.jpg',
extname: 'png',
name: 'shuijiao.png'
}, {
url: 'https://images.weserv.nl/?url=https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg',
extname: 'png',
name: 'uniapp-logo.png'
}, {
url: 'https://images.weserv.nl/?url=https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg',
extname: 'png',
name: 'shuijiao.png'
}]
}
},
methods: {
// ...
}
}
</script>