1.0.3
electron1.8.7, "vee-validate": "^2.1.0-beta.7", "vue": "^2.3.3",
没有warning
有warning
vue-antd-ui 版本没这个问题
same problem.
请提供可运行的复现issue链接
code sand box里面不能重现,不知道是不是打包的问题,还有我的环境是在electron里面使用vue。大神能否自己弄一个electron环境,很好重现。
vue.esm.js?efeb:591 [Vue warn]: Failed to resolve directive: ant-input
(found in <AInput>)
warn @ vue.esm.js?efeb:591
resolveAsset @ vue.esm.js?efeb:1512
normalizeDirectives$1 @ vue.esm.js?efeb:6279
_update @ vue.esm.js?efeb:6203
updateDirectives @ vue.esm.js?efeb:6196
patchVnode @ vue.esm.js?efeb:5931
patch @ vue.esm.js?efeb:6096
Vue._update @ vue.esm.js?efeb:2670
updateComponent @ vue.esm.js?efeb:2788
get @ vue.esm.js?efeb:3142
run @ vue.esm.js?efeb:3219
flushSchedulerQueue @ vue.esm.js?efeb:2981
(anonymous) @ vue.esm.js?efeb:1837
flushCallbacks @ vue.esm.js?efeb:1758
vue.esm.js?efeb:591 [Vue warn]: Failed to resolve directive: ant-input
(found in <AInput>)
和electron没有任何关系,和vee-validate也没有任何关系,
目测是你的构建工具打包的问题,如果实在找不到问题,可以入口处添加如下代码注册指令:
import antInputDirective from 'ant-design-vue/es/_util/antInputDirective'
Vue.use(antInputDirective)
I think i found the solution, this was happened when you use electron-vue to build your project, i have got the same problem
Failed to resolve directive: ant-input
and <a-tooltip> didn't work
so, if you are using electron-vue you should change the following config at .electron-vue/webpack.renderer.config.js add ant-design-vue to whitelist
/**
* 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 可以改改配置,让 webpack 不认为 ant-design-vue 是外部组件,让 vue-loader 加载即可,另外也不需要额外加载 directive
感谢你解决了我的问题
感谢 @hefengxian 提供的建议,修复了我的问题。
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I think i found the solution, this was happened when you use
electron-vueto build your project, i have got the same problemand
<a-tooltip>didn't workso, if you are using
electron-vueyou should change the following config at.electron-vue/webpack.renderer.config.jsaddant-design-vueto whitelist如果用
electron-vue可以改改配置,让 webpack 不认为ant-design-vue是外部组件,让vue-loader加载即可,另外也不需要额外加载directive