How to use the @vue/compiler-core.generate function in @vue/compiler-core

To help you get started, we’ve selected a few @vue/compiler-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vuejs / vue-next / packages / compiler-dom / __tests__ / transforms / vModel.spec.ts View on Github external
test('.lazy', () => {
      const root = transformWithModel('<input>')

      expect(generate(root).code).toMatchSnapshot()
    })
  })
github vuejs / vue-next / packages / compiler-dom / __tests__ / transforms / vShow.spec.ts View on Github external
test('simple expression', () =&gt; {
    const ast = transformWithShow(`<div>`)

    expect(generate(ast).code).toMatchSnapshot()
  })
</div>
github vuejs / vue-next / packages / compiler-sfc / __tests__ / templateTransformSrcset.spec.ts View on Github external
function compileWithSrcset(template: string) {
  const ast = baseParse(template)
  transform(ast, {
    nodeTransforms: [transformSrcset, transformElement],
    directiveTransforms: {
      bind: transformBind
    }
  })
  return generate(ast, { mode: 'module' })
}
github vuejs / vue-next / packages / compiler-sfc / __tests__ / templateTransformAssetUrl.spec.ts View on Github external
function compileWithAssetUrls(template: string) {
  const ast = baseParse(template)
  transform(ast, {
    nodeTransforms: [transformAssetUrl, transformElement],
    directiveTransforms: {
      bind: transformBind
    }
  })
  return generate(ast, { mode: 'module' })
}