electron-vue [Vue warn]: Failed to resolve directive: decorator


electron-vue引入ant-desigin-vue使用ant自定義指令 v-decorator報銷

        <a-form-item>
          <a-input
            v-decorator="[
              'username',
              {
                rules: [{ required: true, message: '請輸入賬號' }],
                initialValue: 'sg_lyc1',
              },
            ]"
            placeholder="賬號"
          >
            <a-icon
              slot="prefix"
              type="user"
              style="color: rgba(0,0,0,.25)"
            />
          </a-input>
        </a-form-item>

解決辦法

在 .electron-vue/webpack.renderer.config.js 添加 ant-design-vue

let whiteListedModules = ['vue', 'ant-design-vue']

參考 https://github.com/vueComponent/ant-design-vue/issues/134


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM