圖片不顯示,其他內容都正常
<template>
????<div?name="show">
????????<ul>
????????????<li?v-for:?good?in?list>
???????????????<img?v-bind:src="good.img">
???????????????<p>{{good.goodName}}</p>?
????????????</li>
????????</ul>
????</div>
</template>
<script>
export?default?{
????name:"show",
????data(){
????????var?obj?=?this;
????????this.$http.get("json/Notebook.json").then(function(res){
????????????obj.list?=?res.data;
????????})
????????return{
????????????list:[]
????????}
????}
}
</script>
2021-05-29
json數據中,img屬性不加路徑可以解決
例:
{
? ? ? ?"name": "hello",
? ? ? ?"img": "good1.png"
? ?},
2021-04-25
錯在v-bind:src=""上,綁定的應該是一個變量才對,good.img顯然不是一個變量