Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用this.$Modal报大堆警告 #2513

Closed
needou opened this issue Nov 28, 2017 · 10 comments
Closed

使用this.$Modal报大堆警告 #2513

needou opened this issue Nov 28, 2017 · 10 comments
Labels

Comments

@needou
Copy link

needou commented Nov 28, 2017

直接使用guangfang官方实例
this.$Modal.confirm({
title: '删除确认',
content: "

确定要删除该条记录
",
onOk:() => {

                }
            });

未放置任何其他代码,报如下警告,之前没有,升级2.7.3后出现

vue.common.js:478 [Vue warn]: $attrs is readonly.

found in

--->

warn @ vue.common.js:478
(anonymous) @ vue.common.js:4152
reactiveSetter @ vue.common.js:991
updateChildComponent @ vue.common.js:2790
prepatch @ vue.common.js:4033
patchVnode @ vue.common.js:5766
patch @ vue.common.js:5937
Vue._update @ vue.common.js:2625
updateComponent @ vue.common.js:2743
get @ vue.common.js:3086
run @ vue.common.js:3163
flushSchedulerQueue @ vue.common.js:2929
(anonymous) @ vue.common.js:1794
flushCallbacks @ vue.common.js:1715
vue.common.js:478 [Vue warn]: $listeners is readonly.

found in

--->

warn @ vue.common.js:478
(anonymous) @ vue.common.js:4155
reactiveSetter @ vue.common.js:991
updateChildComponent @ vue.common.js:2791
prepatch @ vue.common.js:4033
patchVnode @ vue.common.js:5766
patch @ vue.common.js:5937
Vue._update @ vue.common.js:2625
updateComponent @ vue.common.js:2743
get @ vue.common.js:3086
run @ vue.common.js:3163
flushSchedulerQueue @ vue.common.js:2929
(anonymous) @ vue.common.js:1794
flushCallbacks @ vue.common.js:1715
vue.common.js:478 [Vue warn]: $attrs is readonly.

found in

--->

warn @ vue.common.js:478
(anonymous) @ vue.common.js:4152
reactiveSetter @ vue.common.js:991
updateChildComponent @ vue.common.js:2790
prepatch @ vue.common.js:4033
patchVnode @ vue.common.js:5508
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
patch @ vue.common.js:5668
Vue._update @ vue.common.js:2462
updateComponent @ vue.common.js:2576
get @ vue.common.js:2919
run @ vue.common.js:2996
flushSchedulerQueue @ vue.common.js:2762
(anonymous) @ vue.common.js:700
nextTickHandler @ vue.common.js:647
vue.common.js:478 [Vue warn]: $listeners is readonly.

found in

--->



warn @ vue.common.js:478
(anonymous) @ vue.common.js:4155
reactiveSetter @ vue.common.js:991
updateChildComponent @ vue.common.js:2791
prepatch @ vue.common.js:4033
patchVnode @ vue.common.js:5508
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
updateChildren @ vue.common.js:5416
patchVnode @ vue.common.js:5519
patch @ vue.common.js:5668
Vue._update @ vue.common.js:2462
updateComponent @ vue.common.js:2576
get @ vue.common.js:2919
run @ vue.common.js:2996
flushSchedulerQueue @ vue.common.js:2762
(anonymous) @ vue.common.js:700
nextTickHandler @ vue.common.js:647
vue.common.js:478 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "type"

found in

--->


@iview-bot
Copy link
Collaborator

Hello, this issue has been closed because it does not conform to our issue requirements. Please use the Issue Helper to create an issue - thank you!

@needou
Copy link
Author

needou commented Nov 28, 2017

找到原因了,升级vue版本和vue-loader即可

@617450941
Copy link

升级到哪个版本 我这升级了还是报错

@webees
Copy link

webees commented Jan 14, 2018

@needou 怎么解决的,我几个月了还没有解决。

@delenzhang
Copy link

同样出现大量问题

@BoleLee
Copy link

BoleLee commented Apr 11, 2018

@needou @ddcouples 请问是什么原因,需要什么版本的vue和vue-loader?

@delenzhang
Copy link

@BoleLee 兄弟解决了么,好像换了还是会的呀,我项目里全部用的import Vue from 'vue';只有在webpack.base.conf.js中resolve配置的是 'vue$': 'vue/dist/vue', 依然是会有Vue warn!

@BoleLee
Copy link

BoleLee commented Apr 18, 2018

@ddcouples 我的问题解决了,改了 import Vue from 'vue' 后就没有警告了,具体原因我也还没有深入了解

@classLfz
Copy link

这个似乎是 webpack 编译时候的问题?我是在 electron-vue 的项目里边使用 iview$Modal.confirm(),也是有这个问题,但是编译打包之后就不会出现了。似乎是把 .electron-vue 下边的 webpack.render.config.js 里边的 25 行 let whiteListedModules = ['vue'] 改为 let whiteListedModules = ['vue', 'iview'] 就可以了?似乎有点类似于添加到白名单的味道...

@IceApriler
Copy link

IceApriler commented Aug 1, 2018

@classLfz 很有用,赞 👍

image

原文:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants