按照官方的文档的写法使用后,点击没有任何效果,也不会报错,很尴尬


最好给出复现链接,方便定位问题
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
Vue.use(Antd)
@iczer
已测试,在electron-vue中大部分组件都无法正常使用
调用modal不会报错,直接打印会显示TypeError: 'caller' and 'arguments' are restricted function properties and cannot be accessed in this context.


每执行this.$error()会插入两个div空节点。
复现代码:

刚试了下,我这里是正常的,win10

<template>
<div>
<a-button @click="open">click me</a-button>
</div>
</template>
<script>
export default {
name: 'Modal',
methods: {
open () {
this.$success({
title: 'hello',
content: 'hello world'
})
}
}
}
</script>
@iczer 你关闭重新run dev一下呢,我也成功过一次。
重启确实不行了,等官方给适配吧
这里有个方案可以解决 #134
或者使用按需加载也可以
@webees 改一下配置就可以了,这个锅不是 ant-design-vue 的,找到 .electron-vue/webpack.renderer.config.js 将 ant-design-vue 加入到白名单
/**
* List of node_modules to include in webpack bundle
*
* Required for specific packages like Vue UI libraries
* that provide pure *.vue files that need compiling
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals
*/
let whiteListedModules = ['vue', 'ant-design-vue']
Electron-Vue 有文档说明这个问题 https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals
谢谢大神解答!
谢谢,麻烦你们了
This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.
Most helpful comment
@webees 改一下配置就可以了,这个锅不是
ant-design-vue的,找到.electron-vue/webpack.renderer.config.js将ant-design-vue加入到白名单Electron-Vue 有文档说明这个问题 https://simulatedgreg.gitbooks.io/electron-vue/content/en/webpack-configurations.html#white-listing-externals