question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

allowing camel-case props

See original GitHub issue

Wouldn’t this …

props: {
  'prop-a': String, // type check constructor
  'prop-b': null, // accept any type
  'prop-c': { // object descriptor
    type: Number,
    required: true,
    default: 100 // new: default value
  }
}

Match the other options more if it was …

props: {
  propA: String, // type check constructor
  propB: null, // accept any type
  propC: { // object descriptor
    type: Number,
    required: true,
    default: 100 // new: default value
  }
}

The camel case would appear in the html as prop-a of course.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yyx990803commented, Jul 3, 2015

I gave it another thought and maybe this can be implemented with backwards compatibility. Vue could detect camel case props and look for hyphenated attributes in HTML.

0reactions
simonmysuncommented, Jul 12, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Material UI's "withStyles" not allow camelCase props?
The problem isn't that material-ui won't accept camel case props. You can confirm that by looking at all these components with camel case...
Read more >
Props | Vue.js
We declare long prop names using camelCase because this avoids having to use quotes when using them as property keys, and allows us...
Read more >
Object, Naming, Props - Gorm Rest Api - GitHub Pages
be consistent · property names must be camelCase · Property names must be an ASCII subset. · Array and collection names should be...
Read more >
camelcase - ESLint - Pluggable JavaScript Linter
/*eslint camelcase: ["error", {allow: ["UNSAFE_componentWillMount"]}]*/ function UNSAFE_componentWillMount() { // ... } 1 2 3 4 5.
Read more >
Vue.js: hyphen-delimited equivalents of camelCased props ...
... of camelCased props are not recognized in templates (camelCase vs. kebab-case) ... attributes 'required-prop' and 'two-way-prop' are not allowed here ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found