我们在用vue渲染页面时,经常会涉及到图片,到是如果按照下面这样,一定会出现问题
<img src="{{item.jpg}}"
因为计算机会直接把花括号内容当做路径来解析,这肯定是会出现问题的。 因此我们借助v-bind来解决这个问题
<img v-bind:src="{{}}">
或者不加花括号
<img :src="item.jpg">
我们在在遍历图片时注意这个问题。