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

错误:

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>
    <div class="whole">
        <h1>123</h1>
    </div>
</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'
              }
          }
      ]
    }
};

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

阅读 5.1k
4 个回答

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

请问这个问题到底是怎么解决的啊,哪里改成ES6了?

老铁,你module.exports拼写错误了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题