File tree 5 files changed +17
-5
lines changed
__testfixtures__/v-bind-sync
5 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ export function removeRange(range: number[]): Operation {
136
136
* @returns {string } The text of the node
137
137
*/
138
138
export function getText ( node : Node , source : string ) : string {
139
- const start = node . range [ 0 ]
140
- const end = node . range [ 1 ]
139
+ const start = node ? .range [ 0 ]
140
+ const end = node ? .range [ 1 ]
141
141
return source . slice ( start , end )
142
142
}
Original file line number Diff line number Diff line change 1
1
import { runTest } from '../../src/testUtils'
2
2
3
3
runTest (
4
- 'Convert usage of slot-scope before vue 2.6 ' ,
4
+ 'Replace .sync modifiers in v-bind with v-model ' ,
5
5
'v-bind-sync' ,
6
6
'v-bind-sync' ,
7
7
'vue' ,
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" hello" >
3
3
<ChildComponent :title.sync =" pageTitle" />
4
+ <ChildComponent v-bind:propName.sync =" foo" />
5
+ <ChildComponent v-bind:[dynamiArg].sync =" foo" />
6
+ <ChildComponent :propName.sync =" foo" />
7
+
8
+ <!-- incorrect usage, not transform -->
9
+ <ChildComponent v-bind.sync =" foo" />
4
10
</div >
5
11
</template >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" hello" >
3
3
<ChildComponent v-model:title =" pageTitle" />
4
+ <ChildComponent v-model:propName =" foo" />
5
+ <ChildComponent v-model:[dynamiArg] =" foo" />
6
+ <ChildComponent v-model:propName =" foo" />
7
+
8
+ <!-- incorrect usage, not transform -->
9
+ <ChildComponent v-bind.sync =" foo" />
4
10
</div >
5
11
</template >
Original file line number Diff line number Diff line change @@ -18,10 +18,10 @@ export const transformAST: VueASTTransformation = context => {
18
18
19
19
export default wrap ( transformAST )
20
20
/**
21
- * search slot attribute nodes
21
+ * search v-bind attribute nodes
22
22
*
23
23
* @param context
24
- * @returns slot attribute nodes
24
+ * @returns v-bind attribute nodes
25
25
*/
26
26
function findNodes ( context : any ) : Node [ ] {
27
27
const { file } = context
You can’t perform that action at this time.
0 commit comments