Skip to content

VNodeDirective expression Typing #10871

Closed
@WORMSS

Description

@WORMSS

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 };
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions