File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
packages/compiler-core/__tests__/transforms Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -265,6 +265,16 @@ describe('compiler: v-for', () => {
265265 )
266266 } )
267267
268+ test ( 'source containing string expression with spaces' , ( ) => {
269+ const { node : forNode } = parseWithForTransform (
270+ `<span v-for="item in state ['my items']" />`
271+ )
272+ expect ( forNode . keyAlias ) . toBeUndefined ( )
273+ expect ( forNode . objectIndexAlias ) . toBeUndefined ( )
274+ expect ( ( forNode . valueAlias as SimpleExpressionNode ) . content ) . toBe ( 'item' )
275+ expect ( ( forNode . source as SimpleExpressionNode ) . content ) . toBe ( "state ['my items']" )
276+ } )
277+
268278 test ( 'missing value' , ( ) => {
269279 const onError = vi . fn ( )
270280 parseWithForTransform ( '<span v-for="in items" />' , { onError } )
You can’t perform that action at this time.
0 commit comments