Vetur: Component Data json format

Created on 20 Aug 2020  路  9Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ

I've read the Component Data docs and have looked through 3rd party implementations of attributes.json and tags.json, but I couldn't find a way to allow for auto-completion and suggestion of custom events, I've tried prefixing props with v-on: and @ but it's not quite the same when you type @ and it brings up a list of all available events to listen on.

component-data feature-request

All 9 comments

I think the current format is very limited. See https://github.com/vuejs/vetur/issues/2090 for something more complete.

I don't find it too limiting, for instance I can generate docs for attributes per specific tag by providing a key of "tag-name/attribute-name", what I'm desperately trying to find is how to generate docs for events, I can't find any examples of that.
Documentation is definitely lacking, I was going through the source code to perhaps figure it out myself, but no luck on that front yet.

I'll close after adding some doc and a schema file.
For now, you can add type: "event" to any attributes.

Thanks @octref , just to clarify, an event type would allow for auto-completion and suggestions with v-on and @?

Cool modeling btw 馃帺

Thanks a lot @octref !

Is this scheduled for an upcoming release? If there's anything I can help with I'd be happy to

I was also wondering if there's any reason to support events prop in tags.json same it's done for attributes, i.e.:

{
  "foo": {
    "description": "Foo tag",
    "attributes": ["bar"],
    "events": ["baz"]
  }
}
Was this page helpful?
0 / 5 - 0 ratings