File tree Expand file tree Collapse file tree 5 files changed +17
-5
lines changed
__testfixtures__/v-bind-sync Expand file tree Collapse file tree 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 {
136136 * @returns {string } The text of the node
137137 */
138138export 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 ]
141141 return source . slice ( start , end )
142142}
Original file line number Diff line number Diff line change 11import { runTest } from '../../src/testUtils'
22
33runTest (
4- 'Convert usage of slot-scope before vue 2.6 ' ,
4+ 'Replace .sync modifiers in v-bind with v-model ' ,
55 'v-bind-sync' ,
66 'v-bind-sync' ,
77 'vue' ,
Original file line number Diff line number Diff line change 11<template >
22 <div class =" hello" >
33 <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" />
410 </div >
511</template >
Original file line number Diff line number Diff line change 11<template >
22 <div class =" hello" >
33 <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" />
410 </div >
511</template >
Original file line number Diff line number Diff line change @@ -18,10 +18,10 @@ export const transformAST: VueASTTransformation = context => {
1818
1919export default wrap ( transformAST )
2020/**
21- * search slot attribute nodes
21+ * search v-bind attribute nodes
2222 *
2323 * @param context
24- * @returns slot attribute nodes
24+ * @returns v-bind attribute nodes
2525 */
2626function findNodes ( context : any ) : Node [ ] {
2727 const { file } = context
You can’t perform that action at this time.
0 commit comments