pub struct DirectiveNode<'a> {
pub name: CompactString,
pub raw_name: Option<CompactString>,
pub exp: Option<ExpressionNode<'a>>,
pub arg: Option<ExpressionNode<'a>>,
pub modifiers: Vec<'a, SimpleExpressionNode<'a>>,
pub for_parse_result: Option<ForParseResult<'a>>,
pub shorthand: bool,
pub loc: SourceLocation,
}Expand description
Directive node (v-if, v-for, v-bind, etc.)
Fields§
§name: CompactStringNormalized directive name without prefix (e.g., “if”, “for”, “bind”)
raw_name: Option<CompactString>Raw attribute name including shorthand (e.g., “@click”, “:class”)
exp: Option<ExpressionNode<'a>>Directive expression
arg: Option<ExpressionNode<'a>>Directive argument (e.g., “click” in @click)
modifiers: Vec<'a, SimpleExpressionNode<'a>>Directive modifiers (e.g., [“stop”, “prevent”] in @click.stop.prevent)
for_parse_result: Option<ForParseResult<'a>>Parsed result for v-for
shorthand: boolWhether this is a Vue 3.4+ same-name shorthand (:foo without value)
loc: SourceLocationImplementations§
Source§impl<'a> DirectiveNode<'a>
impl<'a> DirectiveNode<'a>
pub fn new( allocator: &'a Bump, name: impl Into<CompactString>, loc: SourceLocation, ) -> DirectiveNode<'a>
pub fn node_type(&self) -> NodeType
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DirectiveNode<'a>
impl<'a> !RefUnwindSafe for DirectiveNode<'a>
impl<'a> !Send for DirectiveNode<'a>
impl<'a> !Sync for DirectiveNode<'a>
impl<'a> Unpin for DirectiveNode<'a>
impl<'a> UnsafeUnpin for DirectiveNode<'a>
impl<'a> !UnwindSafe for DirectiveNode<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more