【问题标题】:How do I use pug with electron-vue?如何将 pug 与电子 vue 一起使用?
【发布时间】:2019-12-04 08:52:10
【问题描述】:

我构建了一个新的 electron-Vue 应用程序并安装了 pug 和 pug-plain-loader 包。当我运行应用程序时,控制台中出现错误:

"Errors compiling template: Component template requires a root element, rather than just text."

我需要添加任何配置或需要下载特定的包才能使其正常工作吗?

【问题讨论】:

    标签: vue.js electron pug electron-packager


    【解决方案1】:

    添加包pugpug-plain-loader

    yarn add pug pug-plain-loader
    

    打开文件webpack.renderer.config.js 将更多选项附加到rules

    {
      module: {
        rules: [
          {
            test: /\.pug$/,
            loader: 'pug-plain-loader'
          }
        ]
      }
    } 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-19
      • 2020-02-01
      • 1970-01-01
      • 2021-09-06
      • 2017-11-20
      • 2015-12-06
      • 2016-11-14
      • 2019-09-20
      相关资源
      最近更新 更多