MCPcopy
hub / github.com/vuejs/core / parseWithVOn

Function parseWithVOn

packages/compiler-core/__tests__/transforms/vOn.spec.ts:18–31  ·  view source on GitHub ↗
(template: string, options: CompilerOptions = {})

Source from the content-addressed store, hash-verified

16import { transformExpression } from '../../src/transforms/transformExpression'
17
18function parseWithVOn(template: string, options: CompilerOptions = {}) {
19 const ast = parse(template, options)
20 transform(ast, {
21 nodeTransforms: [transformExpression, transformElement, transformFor],
22 directiveTransforms: {
23 on: transformOn,
24 },
25 ...options,
26 })
27 return {
28 root: ast,
29 node: ast.children[0] as ElementNode,
30 }
31}
32
33describe('compiler: transform v-on', () => {
34 test('basic', () => {

Callers 1

vOn.spec.tsFile · 0.70

Calls 2

transformFunction · 0.90
parseFunction · 0.50

Tested by

no test coverage detected