diff --git a/src/api/built-in-directives.md b/src/api/built-in-directives.md index 57ad4dd055..70ba5fea74 100644 --- a/src/api/built-in-directives.md +++ b/src/api/built-in-directives.md @@ -1,5 +1,27 @@ # Built-in Directives {#built-in-directives} +## v-match (RFC Reference Implementation) {#v-match} + +These directives are proposed in [RFC #823](https://github.com/vuejs/rfcs/pull/823). They are available only in its Draft reference implementation, not in a released Vue version. + +- **`v-match` expects:** a subject expression. +- **Shorthand, arguments, and modifiers:** none. + +`v-match` evaluates one subject and selects the first matching direct `v-when` child. Patterns support literals, values, objects, arrays, `_`, `const` bindings, rest, `|` alternatives, parentheses, and `as` bindings. Bindings are local to the selected arm. The reference type checker requires exhaustive coverage by default. + +An SFC may place `v-match` directly on its top-level `