feat(compiler): expression prefixing + v-for scope analysis

This commit is contained in:
Evan You
2019-09-23 13:25:18 -04:00
parent b04be6a561
commit e57cb51066
8 changed files with 209 additions and 97 deletions

View File

@@ -3,13 +3,16 @@ import { compile } from '../../src'
test(`should work`, async () => {
const { code, map } = compile(
`<div v-if="hello">{{ ({ a }, b) => a + b + c }}</div>`,
`<div v-for="i in foo">
{{ ({ a }, b) => a + b + i + c }} {{ i + 'fe' }} {{ i }}
</div>
<p>{{ i }}</p>
`,
{
useWith: false
}
)
console.log(code)
console.log(map)
const consumer = await new SourceMapConsumer(map!)
const pos = consumer.originalPositionFor({
line: 4,