vue.js - vue-instagram :图像显示为图标,即使 src/url 是正确的
问题描述
我正在使用 vue-instagram 组件来显示来自我自己的 instagram 帐户的图像。网址是正确的(当我检查元素并在新选项卡中打开网址时,图像会显示...),但它只显示作为一个图标(见下图)..
这是我的代码:(来自示例的样板):
<template>
<vue-instagram token="209161622.1677ed0.cd18b9a41f0c4a53b646b8f012f465ab" :count="5" mediaType="image">
<template slot="feeds" slot-scope="props">
<!-- <li class="fancy-list"> {{ props.feed.link }} </li> -->
<img :src="props.feed.link" />
</template>
<template slot="error" slot-scope="props">
<div class="fancy-alert"> {{ props.error.error_message }} </div>
</template>
</vue-instagram>
import VueInstagram from 'vue-instagram'
export default {
components: {
VueInstagram,
}
}
</script>
如下图所示,它只显示图标,而不显示图片本身:
知道我在这里做错了什么吗?
解决方案
您的链接指向帖子(HTML 页面),而不是直接指向图像,因此它们不能显示为图像。
通过窥探组件的 Github 页面,您似乎想要
<img :src="props.feed.images.low_resolution.url" alt="Image">
推荐阅读
- javascript - 未捕获的 TypeError:无法在 Chrome 扩展中读取 null 的属性“classList”
- java - java中普通类对象和包装类对象有什么区别
- python - 如何将通过Matlab GUIDE获得的不同形状和颜色的文件名存储在一个位置
- file-upload - SIM800C GSM AT COMMAND 如何以编程方式上传 .amr 音频文件
- aws-codebuild - AWS CodeBuild 由非 root 用户使用 `run-as` 构建规范
- javascript - 如何从 div[html+jquery] 中获取文本
- c++ - 如何在透视图中绘制文本
- c - 为什么 printf("value: %f",10/2); 输出 0.000000?
- machine-learning - 如何修复“ValueError:发现样本数量不一致的输入变量:[32979, 21602]”?
- vba - ThisDocument 对象引用