当我运行我的vue项目时,我得到了下面的错误:
./node_modules/vue-loader/lib/template-compiler?{"id":"data-v-003cf1bf","hasScoped":true,"buble":{"transforms":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./node_modules/iview-loader??ref--0-1!./src/components/common/path-nav.vue
(Emitted value instead of an instance of Error)
Error compiling template:
<div class="path-nav">
<i-breadcrumb>
<i-breadcrumb-item v-for="route in route_list" to="{{route.route}}">{{ route.name }}</i-breadcrumb-item>
</i-breadcrumb>
</div>我的关键代码如下:
<template>
<div class="path-nav">
<i-breadcrumb>
<i-breadcrumb-item v-for="route in route_list" to="{{route.route}}">{{ route.name }}</i-breadcrumb-item>
</i-breadcrumb>
</div>
</template>如果我评论一下:
<i-breadcrumb-item v-for="route in route_list" to="{{route.route}}">{{ route.name }}</i-breadcrumb-item>在那里,我不会得到这个错误。
发布于 2018-03-08 11:13:05
这个
to="{{route.route}}"已在Vue.js2中被废弃和删除。
您可以使用
:to="route.route"https://stackoverflow.com/questions/49171712
复制相似问题