Skip to content

When listing a Component's model, show the function signature of a value #133

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

Closed
sirlancelot opened this issue Aug 5, 2016 · 1 comment

Comments

@sirlancelot
Copy link
Contributor

sirlancelot commented Aug 5, 2016

If the value of a property of a Vue data model is a function. Vue Devtools currently just shows "Function" as the value. It would be neat if it showed the function signature instead (eg. "function someFunction(arg)").

You can get the signature by calling .toString() on the function and getting everything up to the closing parenthesis:

if (typeof value === "function") {
    const valueStr = value.toString()
    return valueStr.slice(0, valueStr.indexOf(")") + 1)
}
@posva
Copy link
Member

posva commented Jan 17, 2017

Definitely. PR are welcome!

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

4 participants