Skip to content

Commit 7c75462

Browse files
authoredMar 30, 2021
fix(types): changed expression type to optional string (#11189)
fix #10871
1 parent 2488a6a commit 7c75462

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
 

‎types/test/options-test.ts

+17
Original file line numberDiff line numberDiff line change
@@ -482,3 +482,20 @@ Vue.component('functional-component-v-model', {
482482

483483

484484
Vue.component('async-es-module-component', () => import('./es-module'))
485+
486+
Vue.component('directive-expression-optional-string', {
487+
render(createElement) {
488+
return createElement("div", {
489+
directives: [
490+
{
491+
name: 'has-expression',
492+
value: 2,
493+
expression: '1 + 1',
494+
}, {
495+
name: 'no-expression',
496+
value: 'foo',
497+
},
498+
],
499+
})
500+
}
501+
});

‎types/vnode.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface VNodeDirective {
6969
name: string;
7070
value?: any;
7171
oldValue?: any;
72-
expression?: any;
72+
expression?: string;
7373
arg?: string;
7474
oldArg?: string;
7575
modifiers?: { [key: string]: boolean };

0 commit comments

Comments
 (0)
Please sign in to comment.