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-vuevue

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

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

相關文章
相關標籤/搜索