Nuxt and simple context menu
rowild opened this issue · 3 comments
Hi! I am trying to implement this component with Nuxt and got it working so far – just not the click on the dropdown (yet).
I wanted to point out, that Nuxt's eslint checks for props and emits and it complains that "elementId" should be hyphenated, while "@option-clicked" could be written camelcase. So the exact opposite of what this extension shows in the example and the documentation.
Not sure if this influences the functionality somehow, but I thought I'll report my observation.
Thanks for mentioning - yea let me double-check this setup. In the past I've researched this, but maybe best practices have changed (or I got it wrong at first). The main issue is that HTML is case insensitive so in some cases it can cause problems.
I'll update here.
Ok so for the prop name, elementId should be camelCase like I have it, but when it's used in the component, it should be in kebab-case. I'll update the docs to reflect that.
If I remember correctly, the same thing goes for emitted events, so that's why really I think the rule is to have camelCase
in the JS, and then kebab-case
in the the template. That's the rule I think is best to follow.
Yes, it's about the spelling in the HTML (template) section. I should have been more precise! Thanks for checking! 👍