Skip to content

Commit 809009d

Browse files
committed
✨ support v-slot shorthand [RFC0002] (refs #39)
1 parent ff1a51a commit 809009d

File tree

10 files changed

+2306
-1
lines changed

10 files changed

+2306
-1
lines changed

src/html/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import {
4747
} from "./intermediate-tokenizer"
4848
import { Tokenizer } from "./tokenizer"
4949

50-
const DIRECTIVE_NAME = /^(?:v-|[:@]).*[^.:@]$/u
50+
const DIRECTIVE_NAME = /^(?:v-|[:@#]).*[^.:@#]$/u
5151
const DT_DD = /^d[dt]$/u
5252
const DUMMY_PARENT: any = Object.freeze({})
5353

src/template/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ function createDirectiveKey(node: VIdentifier): VDirectiveKey {
108108
ret.name = raw.name = "on"
109109
ret.shorthand = true
110110
i = 1
111+
} else if (id.startsWith("#")) {
112+
ret.name = raw.name = "slot"
113+
ret.shorthand = true
114+
i = 1
111115
} else {
112116
const colon = id.indexOf(":")
113117
if (colon !== -1) {

0 commit comments

Comments
 (0)