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

it can't generate events from this.$emit(CLICK_EVENT) #11

Closed
cuijing1031 opened this issue Nov 27, 2018 · 3 comments
Closed

it can't generate events from this.$emit(CLICK_EVENT) #11

cuijing1031 opened this issue Nov 27, 2018 · 3 comments

Comments

@cuijing1031
Copy link

cuijing1031 commented Nov 27, 2018

There is a coding rule in our team that event names are defined by const variables in upper case。The code is like:

const EVENT_CLOSE = 'close'
// ...
this.$emit(EVENT_CLOSE, e)

But in this case, the result of bt.isStringLiteral(args[0]) is false

if (args.length && bt.isStringLiteral(args[0])) {
     result.name = args[0].value;
}

so the events block is empty in the markdown file.

@HcySunYang
Copy link
Member

Um... I think about how to improve

@HcySunYang
Copy link
Member

HcySunYang commented Jan 4, 2019

Who has a better idea?

roxburghm added a commit to roxburghm/vuese that referenced this issue Mar 26, 2019
If an emit uses a constant rather than a string literal then the constant name is rendered in the
markup in code quotes eg `CONSTANT` and the emit event is included in the docs

Closes vuese#11
@roxburghm
Copy link
Contributor

Run across this myself and it's fixed in my latest pull request #58 along with the addition of compute docs.

Events

Event Name Description Parameters
PASS_CALLBACK an event that uses a constant for the callback -
hiya an event that uses a string literal for the callback -

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