vue 报错Failed to mount component: template or render function not defined

路由:

主页面组件的js由页面内改为外部引入后报此错

//再看组件引入

import fxkh from './floodControl/index'

因此vue-loader在引入时把index.js当作了入口,而不是index.vue,只需把组件引入改为

import fxkh from './floodControl/index.vue'
原文地址:https://www.cnblogs.com/wwj007/p/13633081.html