美文网首页
解决vue报You are using the runtime-

解决vue报You are using the runtime-

作者: CoderZb | 来源:发表于2021-06-26 10:16 被阅读0次

    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,这种情况下,模板编译器是不可用的,可以将模板预编译为呈现函数,也可以使用编译器包含的内部版本。

    解决办法,将vue.config.js文件中增加vue$: "vue/dist/vue.esm.js",,然后重新运行项目即可。

    configureWebpack: (config) => {
            Object.assign(config, {
              // 开发生产共同配置
              resolve: {
                alias: {
                   vue$: "vue/dist/vue.esm.js",// 增加该行即可
                  '@': path.resolve(__dirname, './src'),
                  '@c': path.resolve(__dirname, './src/components'),
                  '@p': path.resolve(__dirname, './src/pages'),
                 'excel': path.resolve(__dirname, '../src/excel'),
                } // 别名配置
              }
            })
          },
    

    相关文章

      网友评论

          本文标题:解决vue报You are using the runtime-

          本文链接:https://www.haomeiwen.com/subject/aaaayltx.html