vue.js为什么在component的template的root标签中不能使用v-for
2017-02-26 · 知道合伙人互联网行家
关注
展开全部
<div v-for="article in articles" style="margin:13px">
<div class="article-image">
<a>
<img :src="article.image_path"/>
</a>
</div>
<div class="article-title">
<h4>{{article.title}}</h4>
</div>
<div class="article-content">
<p v-html="article.content"></p>
</div>
</div>
</script>
<script type="text/javascript">
Vue.component('article_item', {
template: "#article-template",
replace: true,
props: {
articles: Array
}
});
</script>
<div class="article-image">
<a>
<img :src="article.image_path"/>
</a>
</div>
<div class="article-title">
<h4>{{article.title}}</h4>
</div>
<div class="article-content">
<p v-html="article.content"></p>
</div>
</div>
</script>
<script type="text/javascript">
Vue.component('article_item', {
template: "#article-template",
replace: true,
props: {
articles: Array
}
});
</script>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询