为什么我的形象不炫耀?
标签显示正确的url,但不显示图像。为什么不展示?需要加点什么吗?以前起作用了。如果我用src纯文本添加普通图像,它就会显示出来
<StackLayout>
<Button text="Make new screensot" />
<Button text="Load images" @tap="loadImages()" />
<Label v-if="!loadedImages" text="Not loaded images" textWrap="true" />
<RadListView v-else for="(item,index) in imagesS"
itemHeight="100">
<v-template>
<StackLayout orientation="vertical">
<Label :text="item.url"></Label>
<Image :src="item.url" stretch="aspectFill" class="screenshots" />
</StackLayout>
</v-template>
</RadListView>
<ActivityIndicator class="activity-indicator" :busy="indicatorS"></ActivityIndicator>
</StackLayout>我添加了css,但没有工作。
.screenshots{
height:100;
width:100;
}方法
methods: {
loadImages() {
console.log('starting loading images');
this.indicatorS = true;
axios.get(this.jsonUsers + this.ID + '/images')
.then((response) => {
const imgCount = response.data.length;
console.log("count- " + imgCount)
var imagesArr = response.data;
console.dir("images - " + response.data[0].url)
this.$store.commit('setImages',imagesArr);
console.log('images fully loaded');
this.$store.commit('setLoadedImages');
this.indicatorS = false;
})
}
}发布于 2019-04-26 02:08:25
我在操场上试过这个。https://play.nativescript.org/?template=play-vue&id=aKZ2wm。
我认为您使用的url不是真正用于图像的,https://imgur.com/a/AkEg8vy,这是您正在使用的URL,它不是用于图像的URL,而是用于网页的URL。
现在,如果我转到页面并获取图像URL https://i.imgur.com/78j1SJr.jpg。它很好用。
https://stackoverflow.com/questions/55859385
复制相似问题