electron-vue中使用iview 報錯this. is readonly的解決辦法



title: electron-vue中使用iview 報錯this. is readonly的解決辦法
toc: false
date: 2019-02-12 19:33:28
categories:

  • Web

tags:

  • vue
  • iview

報大段xxx is readonly的解決辦法

修改.electron-vue文件夾中的webpack.renderer.config.js內第22行的

let whiteListedModules = ['vue']

為:

let whiteListedModules = ['vue', 'iview']

即可。

原理:

.electron-vue/webpack.renderer.config.js

Targets electron's renderer process. This configuration handles your Vue application, so it includes vue-loader and many other configurations that are available in the official vuejs-templates/webpack boilerplate.

White-listing Externals

One important thing to consider about this config is that you can whitelist specific modules to not treat as webpack externals. There aren't many use cases where this functionality is needed, but for the case of Vue UI libraries that provide raw *.vue components they will need to be whitelisted, so vue-loader is able to compile them. Another use case would be using webpack aliases, such as setting vue to import the full Compiler + Runtime build. Because of this, vue is already in the whitelist.

參考鏈接: https://github.com/iview/iview/issues/2513


免責聲明!

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



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