Skip to content

Commit 99741b8

Browse files
committed
chore: vmodel WIP
1 parent 6558afd commit 99741b8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

packages/runtime-dom/src/directives/vModel.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,10 @@ if (__NODE_JS__) {
325325
}
326326
}
327327
}
328+
329+
export type VModelDirective =
330+
| typeof vModelText
331+
| typeof vModelCheckbox
332+
| typeof vModelSelect
333+
| typeof vModelRadio
334+
| typeof vModelDynamic

packages/runtime-dom/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ import {
99
App,
1010
RootHydrateFunction,
1111
isRuntimeOnly,
12-
DefineComponent
12+
DefineComponent,
13+
Directive,
14+
Directive,
15+
Directive
1316
} from '@vue/runtime-core'
1417
import { nodeOps } from './nodeOps'
1518
import { patchProp, forcePatchProp } from './patchProp'
@@ -19,6 +22,7 @@ import { TransitionProps } from './components/Transition'
1922
import { TransitionGroupProps } from './components/TransitionGroup'
2023
import { vShow } from './directives/vShow'
2124
import { VOnDirective } from './directives/vOn'
25+
import { VModelDirective } from './directives/vModel'
2226

2327
declare module '@vue/reactivity' {
2428
export interface RefUnwrapBailTypes {
@@ -35,8 +39,13 @@ declare module '@vue/runtime-core' {
3539
}
3640

3741
interface GlobalDirectives {
42+
// Note: if updating this, also update `types/globalDirectives.d.ts`.
3843
vShow: typeof vShow
3944
vOn: VOnDirective
45+
vBind: VModelDirective
46+
vIf: Directive<any, boolean>
47+
VOnce: Directive
48+
VSlot: Directive
4049
}
4150
}
4251

0 commit comments

Comments
 (0)