javascript - vue reported an error. Yesterday I wrote the same thing and no error was reported, but today it reported an error. I don't know the reason. Seek solution
習慣沉默
習慣沉默 2017-07-05 10:46:51
0
1
909

mistake:

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'
              }
          }
      ]
    }
};

Yesterday I wrote the same thing and no error was reported, but today it was reported an error. I don’t know the reason. Seek solution.

習慣沉默
習慣沉默

reply all(1)
巴扎黑

It would be fine if I changed it to es6, but I don’t know why it was fine yesterday

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!