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

VNodeDirective expression Typing #10871

Open
WORMSS opened this issue Nov 28, 2019 · 1 comment
Open

VNodeDirective expression Typing #10871

WORMSS opened this issue Nov 28, 2019 · 1 comment

Comments

@WORMSS
Copy link

@WORMSS WORMSS commented Nov 28, 2019

What problem does this feature solve?

Currently the type for expression for VNodeDirective is optional any.

export interface VNodeDirective {
  name: string;
  value?: any;
  oldValue?: any;
  expression?: any;
  arg?: string;
  oldArg?: string;
  modifiers?: { [key: string]: boolean };
}

But if I am understanding expression usage correctly, this is the string representation of what is passed into the

<div v-my-directive="moose"></div>

So even though moose may be data or computer or something that returns 'not-moose' value, the expression itself is 'moose'.

So should this not be an optional string?

export interface VNodeDirective {
  name: string;
  value?: any;
  oldValue?: any;
  expression?: string;
  arg?: string;
  oldArg?: string;
  modifiers?: { [key: string]: boolean };
}
@Shubhamchinda

This comment has been minimized.

Copy link

@Shubhamchinda Shubhamchinda commented Dec 6, 2019

Hey, I'd like to work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.