243
文章
15
说说
193
评论
247549
访问

个人博客网站:prettywordpress.com(吃饭用大碗的程序猿)

最新评论
qq_avatar
1年前,”四五设计网”在《如何使用百度云CDN优化wordpress速度》
说:来学习一下,应该用得上
qq_avatar
2年前,” ”在《友情链接》
说:像不能用了更新地址为 https://aba.pet/wp-content/uploads/2022/05/favicon-1.gif
qq_avatar
2年前,”Alex”在《终于找到拖慢网站的罪魁祸首》
说:优化这么快,你有想过我们的感觉?
qq_avatar
3年前,”ヘル”在《码农=新生代农民工》
说:打卡@[huaixiao]
qq_avatar
3年前,”肋巴骨”在《Win10系统桌面一直闪屏自动刷新怎么办》
说:不错啊,这是谁写的教程,真棒
A+

解决schema2code生成banner页的uni-file-picker无法显示图片的问题

标签: 最后编辑:2022年1月14日

项目场景:

搭建uni-admin,使用schema2code生成uni-admin后台轮播图展示界面,图片组件未正常显示图片

schema2code生成的代码

<uni-td align="center">
    <template v-for="(file, j) in item.imgs">
        <uni-file-picker v-if="file.fileType == 'image'" :value="file" :file-mediatype="file.fileType" :imageStyles="imageStyles" readonly></uni-file-picker>
        <uni-link v-else :href="file.url" :text="file.url"></uni-link>
    </template>
</uni-td>

我的解决方法:

:value="file"改为v-model="item.imgs[j]",即可正常显示。
如果使用上篇教程的文章改为v-model="file"会抛出
v-model cannot be used on v-for or v-slot scope variables because they are not writable.的错误

造成原因

未知...

知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

发表一下你的评论呗

回复评论代表你同意网站的 隐私政策

... 友情提示 请保留版权标识
复制成功!
目录