v-for使用注意点
v-for使用注意点
v-for属性不能放在绑定的根元素上
绑定在根元素上会报错:Cannot use v-for on stateful component root element because it renders multiple elements.
同时根元素也不能是<template>
// 创建组件
Vue.component('blog-post', {
props: ['title'],
template: '<h3>{{ titl
原创
2021-05-15 20:14:22 ·
224 阅读 ·
0 评论