vue template([Vue warn]: You are using the runtime-only build of Vue where the template compiler ...

报错内容([Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.)

vue的emplate,不能直接使用npm install之后的vue,需要在webpack里面添加几行代码:

resolve: {

    alias: {

        'vue': 'vue/dist/vue.js'

    }

}

或者

resolve: {

    alias: {

        vue$: 'vue/dist/vue.common.js'    //alias 支持$符号来缩小范围到只命中以关键字结尾的导入语句

    }

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。