Skip to content

Commit 884ee58

Browse files
committed
Add model rootAttribute
1 parent 89b71b7 commit 884ee58

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

packages/babel-plugin-transform-vue-jsx/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { addDefault } from '@babel/helper-module-imports'
33

44
const xlinkRE = /^xlink([A-Z])/
55
const directiveRE = /^v-/
6-
const rootAttributes = ['class', 'style', 'key', 'ref', 'refInFor', 'slot', 'scopedSlots']
6+
const rootAttributes = ['class', 'style', 'key', 'ref', 'refInFor', 'slot', 'scopedSlots', 'model']
77
const prefixes = ['props', 'domProps', 'on', 'nativeOn', 'hook', 'attrs']
88
const domPropsValueElements = ['input', 'textarea', 'option', 'select']
99
const domPropsElements = [...domPropsValueElements, 'video']

packages/babel-plugin-transform-vue-jsx/test/snapshot.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ const tests = [
8282
key="key"
8383
ref="ref"
8484
refInFor
85-
slot="slot">
85+
slot="slot"
86+
model={{
87+
value: this.txt,
88+
callback: $$v => {
89+
this.txt = $$v
90+
}
91+
}}>
8692
</div>
8793
))`,
8894
to: `render(h => h("div", {
@@ -91,7 +97,13 @@ const tests = [
9197
"key": "key",
9298
"ref": "ref",
9399
"refInFor": true,
94-
"slot": "slot"
100+
"slot": "slot",
101+
"model": {
102+
value: this.txt,
103+
callback: $$v => {
104+
this.txt = $$v;
105+
}
106+
}
95107
}));`,
96108
},
97109
{

0 commit comments

Comments
 (0)