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

Datepicker warning: "class" is a reserved attribute and cannot be used as component prop #81

Open
viamin opened this issue May 21, 2017 · 9 comments

Comments

@viamin
Copy link

viamin commented May 21, 2017

I'm seeing this warning in my console when using the Datepicker component.

[Vue warn]: "class" is a reserved attribute and cannot be used as component prop.
found in
---> <DatePicker> at .../node_modules/vue-blu/src/components/datepicker/Datepicker.vue

Datapicker.vue has this:

   props: {
    options: {
      type: Object,
      default() {},
    },
    name: String,
    placeholder: String,
    val: String,
    value: {},
    class: String,
  },

The class prop isn't used in the component as far as I can tell.

@Youdaman
Copy link

Guessing it should be 'class': String instead?

viamin added a commit to viamin/vue-blu that referenced this issue May 21, 2017
@kevcodez
Copy link

+1

@nghiatv
Copy link

nghiatv commented Jul 21, 2017

did it in npm?
yarn upgrade vue-blu
still has warn?

@yanhamu
Copy link

yanhamu commented Jul 23, 2017

still there

@raideltorres
Copy link

raideltorres commented Jul 25, 2017

more or less when this is going to be solved?

galbacarys pushed a commit to galbacarys/vue-blu that referenced this issue Aug 25, 2017
Props named `class` aren't allowed in Vue.js since it's a reserved
propname, and there's no reason to do it anyway as it isn't used
anywhere in the component. It should be removed to silence the warning
when using the component.

Resolves chenz24#81.
@sorin21
Copy link

sorin21 commented Sep 18, 2017

The error is still there. I looked to the code and class is still in the

  props: {
    options: {
      type: Object,
      default() {},
    },
    name: String,
    placeholder: String,
    val: String,
    value: {},
    class: String,
  }

I removed myself but I still get the error

"class" is a reserved attribute and cannot be used as component prop

@jairodemorais
Copy link

Same error here!

@raideltorres
Copy link

as a workaround till they merge the solution what I did was add the library as local (so npm wont rewrite my change) and removed the class: String line from the file I'm using, remember to do this from the .min file is as well. Maybe that's your issue @sorin21 .

@galbacarys
Copy link

@raideltorres @jairodemorais I've put in a PR for this and reached out to @chenz24 a few times to see if he can close this. I haven't heard anything back, but in the meantime the fork on my account has the fix.

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

No branches or pull requests

9 participants