fix(compiler): generate correct mappings for v-for and object properties (#69)
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
MERGE_PROPS,
|
||||
TO_HANDLERS
|
||||
} from '../runtimeConstants'
|
||||
import { getInnerRange } from '../utils'
|
||||
|
||||
const toValidId = (str: string): string => str.replace(/[^\w]/g, '')
|
||||
|
||||
@@ -121,7 +122,7 @@ function buildProps(
|
||||
const { loc, name, value } = prop
|
||||
properties.push(
|
||||
createObjectProperty(
|
||||
createExpression(name, true, loc),
|
||||
createExpression(name, true, getInnerRange(loc, 0, name.length)),
|
||||
createExpression(
|
||||
value ? value.content : '',
|
||||
true,
|
||||
|
||||
@@ -25,7 +25,7 @@ export const transformFor = createStructuralDirectiveTransform(
|
||||
|
||||
context.replaceNode({
|
||||
type: NodeTypes.FOR,
|
||||
loc: node.loc,
|
||||
loc: dir.loc,
|
||||
source,
|
||||
valueAlias: value,
|
||||
keyAlias: key,
|
||||
|
||||
Reference in New Issue
Block a user