v6.0.0
This release supported the new syntax in Vue.js 2.6 🎉
- The shorthand of
v-bind
directive with.prop
modifier. (actually, this is experimental and behind flag in Vue.js 2.6) - New
v-slot
directive and that shorthand. (https://vuejs.org/v2/api/#v-slot) - New dynamic arguments. (https://vuejs.org/v2/guide/syntax.html#Dynamic-Arguments)
Breaking changes
This release contains a drastic change about VDirectiveKey
AST node because now the directive key have gotten to be able to have JavaScript expression.
export interface VDirectiveKey extends HasLocation, HasParent {
type: "VDirectiveKey"
parent: VAttribute
- name: string
- argument: string | null
- modifiers: string[]
- shorthand: boolean
+ name: VIdentifier
+ argument: VExpressionContainer | VIdentifier | null
+ modifiers: VIdentifier[]
}
- It changed the members
name
,argument
, andmodifiers
to AST nodes from strings. Especially,argument
will be aVExpressionContainer
node if the directive has dynamic argument syntax. - It removed
shorthand
member. To check wheather the directive key is a shorthand or not, usename.rawName
member.:foo
...directiveKey.name.rawName
is":"
(anddirectiveKey.name.name
is"bind"
)..foo
...directiveKey.name.rawName
is"."
(anddirectiveKey.name.name
is"bind"
anddirectiveKey.modifiers
includes the identifier node of"prop"
).@foo
...directiveKey.name.rawName
is"@"
(anddirectiveKey.name.name
is"on"
).#foo
...directiveKey.name.rawName
is"#"
(anddirectiveKey.name.name
is"slot"
).