您的位置:首页技术文章
文章详情页

javascript - vue报错,昨天也是这么写的也没报错呀,今天就报错了,不知原因。求解决

【字号: 日期:2023-03-24 16:27:33浏览:64作者:猪猪

问题描述

错误:

bundle.js:9657 [Vue warn]: Failed to mount component: template or render function not defined.found in---> <Anonymous> <Root>index.js

var Vue = require( ’vue’ ), Vpp = require( ’./vpp.vue’ );console.log( Vue );new Vue.default( { el : ’#vpp’, render : function( h ) {return h( Vpp ) }} );vpp.vue

<style></style><template> <p class='whole'><h1>123</h1> </p></template><script> module.explore = {data : function() { return { }} }</script>webpack.config.js

module.exports = { entry : { bundle : ’./src/index.js’ }, output : { path : __dirname + ’/build’,filename : ’[name].js’ }, module : { rules : [ { test : /.vue$/g, use : { loader : ’vue-loader’ } } ] }};

昨天也是这么写的也没报错呀,今天就报错了,不知原因。求解决。

问题解答

回答1:

换成es6的写法就好了,但昨天为啥好好的,不知道了

标签: JavaScript