美文网首页
Vue Devtools显示多个Root问题

Vue Devtools显示多个Root问题

作者: Jesse_001 | 来源:发表于2021-10-18 11:56 被阅读0次

如图,今天开发时查看devtools显示多个Root节点。


devtools显示多个Root.png

问题原因:在router.js文件里引入了Vue和VueRouter。
解决方法:把Vue和VueRouter的引入和use都提出来放到main.js即可,router.js里只保留各页面路由相关配置。

import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

相关文章

网友评论

      本文标题:Vue Devtools显示多个Root问题

      本文链接:https://www.haomeiwen.com/subject/wvxnoltx.html