})
test('de-structured value', () => {
- const source = '<span v-for="( { id, key })in items" />'
+ const source = '<span v-for="( { id, key }) in items" />'
const forNode = parseWithForTransform(source)
const valueIndex = source.indexOf('{ id, key }')
import { RENDER_LIST } from '../runtimeConstants'
import { processExpression } from './transformExpression'
-const forAliasRE = /([\s\S]*?)(?:(?<=\))|\s+)(?:in|of)\s+([\s\S]*)/
-const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
-const stripParensRE = /^\(|\)$/g
-
export const transformFor = createStructuralDirectiveTransform(
'for',
(node, dir, context) => {
}
)
+const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/
+const forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/
+const stripParensRE = /^\(|\)$/g
+
interface ForParseResult {
source: ExpressionNode
value: ExpressionNode | undefined