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

MessageBox does't work #119

Closed
Alideniz opened this issue Nov 27, 2017 · 13 comments
Closed

MessageBox does't work #119

Alideniz opened this issue Nov 27, 2017 · 13 comments

Comments

@Alideniz
Copy link

Alideniz commented Nov 27, 2017

Version & browser

0.14.1

Which component

MessageBox

Steps to reproduce the problem

I want to normally use it

Expected behavior

show me a normal message box without errors

Actual behavior

it gives me errors from modal component $attr and $listeners

@wxsms
Copy link
Member

wxsms commented Nov 27, 2017

Make sure you're using 0.14.1 not 0.14.0, and it should work as the document examples. If it doesn't, pls paste your code here so I can help you with.

@Alideniz
Copy link
Author

I just tried example in the document. However it gives me warnings like this

 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: "value"
$listeners is readonly.
$attrs is readonly.

@wxsms
Copy link
Member

wxsms commented Nov 27, 2017

While I can see no such problem: https://codepen.io/wxsm/pen/KyxVOg

@Alideniz
Copy link
Author

I have too much nested vue instance. Can it be related ?

@wxsms
Copy link
Member

wxsms commented Nov 27, 2017

I don't think so.

Maybe you can try reproduce the problem you found in some place such as codepen? I can do nothing if I can't reproduce it. Thanks.

@wxsms wxsms added the invalid label Nov 28, 2017
@Alideniz
Copy link
Author

we are using browserify for the SFC compiling. Is there any problem working with browserify?

@wxsms
Copy link
Member

wxsms commented Nov 30, 2017

I have not try with browserify, but it is supposed to work with commonjs / es6 env. If other components work as expect then this one should be the same.

Maybe you can try to import and use it individually and see what happens: https://uiv.wxsm.space/message-box/#import-individually

@natecox
Copy link

natecox commented Dec 2, 2017

I'm seeing the same issue.

const label = await MessageBox.prompt({
  title: 'Column Rename',
  content: 'Please set your preferred name for this column',
})

Results in

[Vue warn]: $listeners is readonly.
[Vue warn]: $attrs is readonly.

It seems to stem from the Modal instance in the MessageBox.

For reference, I'm also using this via browserify + vueify

@wxsms
Copy link
Member

wxsms commented Dec 2, 2017

ok. I see the problem now by testing on a browserify project. this is very strange since it only appears in vueify but not vue-loader, even with exactly the same vue and vue-template-complier versions. I may need some time to fix this. pls just ignore the warning by now.

@wxsms
Copy link
Member

wxsms commented Dec 2, 2017

I can solve this by changing my vuejs in project to runtime build.

For example, in package.json:

{
  ...
  "browser": {
    "vue": "vue/dist/vue.runtime.common.js"
  },
  ...
}

or in the entry of the app:

import Vue from 'vue/dist/vue.runtime.common'
import * as uiv from 'uiv'

Vue.use(uiv)

Both of them will show no warnings anymore. but I still don't know why...

@wxsms
Copy link
Member

wxsms commented Dec 2, 2017

@Alideniz @natecox pls let me know if these work or not. thanks.

@Alideniz
Copy link
Author

Alideniz commented Dec 2, 2017

@wxsms it worked !!! 👍 thank you

@wxsms wxsms removed the bug label Dec 3, 2017
@wxsms
Copy link
Member

wxsms commented Dec 8, 2017

Closing since have a solution and not a bug of this lib.

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

No branches or pull requests

3 participants