exports[`compiler: codegen CacheExpression 1`] = `
"
-export default function render() {
+export function render() {
const _ctx = this
const _cache = _ctx.$cache
return _cache[1] || (_cache[1] = foo)
exports[`compiler: codegen CacheExpression w/ isVNode: true 1`] = `
"
-export default function render() {
+export function render() {
const _ctx = this
const _cache = _ctx.$cache
return _cache[1] || (
exports[`compiler: codegen module mode preamble 1`] = `
"import { createVNode, resolveDirective } from \\"vue\\"
-export default function render() {
+export function render() {
const _ctx = this
return null
}"
exports[`compiler: integration tests module mode 1`] = `
"import { toString, openBlock, createVNode, createBlock, createCommentVNode, Fragment, renderList, createTextVNode } from \\"vue\\"
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(\\"div\\", {
id: \\"foo\\",
const _hoisted_2 = createVNode(\\"div\\", null, \\"world\\")
popScopeId()
-export default withId(function render() {
+export const render = withId(function render() {
const _ctx = this
return (openBlock(), createBlock(\\"div\\", null, [
_hoisted_1,
"import { createVNode, resolveComponent, createBlock, openBlock, withScopeId } from \\"vue\\"
const withId = withScopeId(\\"test\\")
-export default withId(function render() {
+export const render = withId(function render() {
const _ctx = this
const _component_Child = resolveComponent(\\"Child\\")
"import { createVNode, resolveComponent, renderList, createSlots, createBlock, openBlock, withScopeId } from \\"vue\\"
const withId = withScopeId(\\"test\\")
-export default withId(function render() {
+export const render = withId(function render() {
const _ctx = this
const _component_Child = resolveComponent(\\"Child\\")
"import { toString, createTextVNode, createVNode, resolveComponent, createBlock, openBlock, withScopeId } from \\"vue\\"
const withId = withScopeId(\\"test\\")
-export default withId(function render() {
+export const render = withId(function render() {
const _ctx = this
const _component_Child = resolveComponent(\\"Child\\")
"import { createVNode, createBlock, openBlock, withScopeId } from \\"vue\\"
const withId = withScopeId(\\"test\\")
-export default withId(function render() {
+export const render = withId(function render() {
const _ctx = this
return (openBlock(), createBlock(\\"div\\"))
})"
})
expect(ast.helpers).toContain(WITH_SCOPE_ID)
expect(code).toMatch(`const withId = withScopeId("test")`)
- expect(code).toMatch(`export default withId(function render() {`)
+ expect(code).toMatch(`export const render = withId(function render() {`)
expect(code).toMatchSnapshot()
})
exports[`compiler: hoistStatic transform prefixIdentifiers should NOT hoist elements with cached handlers 1`] = `
"import { createVNode, createBlock, openBlock } from \\"vue\\"
-export default function render() {
+export function render() {
const _ctx = this
const _cache = _ctx.$cache
return (openBlock(), createBlock(\\"div\\", null, [
exports[`compiler: transform v-model compound expression (with prefixIdentifiers) 1`] = `
"import { createVNode, createBlock, openBlock } from \\"vue\\"
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(\\"input\\", {
modelValue: _ctx.model[_ctx.index],
exports[`compiler: transform v-model simple exprssion (with prefixIdentifiers) 1`] = `
"import { createVNode, createBlock, openBlock } from \\"vue\\"
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(\\"input\\", {
modelValue: _ctx.model,
exports[`compiler: transform v-model with dynamic argument (with prefixIdentifiers) 1`] = `
"import { createVNode, createBlock, openBlock } from \\"vue\\"
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(\\"input\\", {
[_ctx.value]: _ctx.model,
}
genHoists(ast.hoists, context)
newline()
- push(`export default `)
+ push(`export `)
}
// enter render function
if (genScopeId) {
- push(`withId(`)
+ push(`const render = withId(`)
}
push(`function render() {`)
indent()
const _hoisted_1 = _imports_0 + '#fragment'
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(\\"use\\", { href: _hoisted_1 }))
}"
exports[`compiler sfc: transform asset url support uri is empty 1`] = `
"import { createVNode, createBlock, openBlock } from \\"vue\\"
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(\\"use\\", { href: '' }))
}"
import _imports_1 from 'fixtures/logo.png'
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(Fragment, null, [
createVNode(\\"img\\", { src: _imports_0 }),
const _hoisted_6 = _imports_0 + '2x, ' + _imports_0 + '3x'
const _hoisted_7 = _imports_0 + ', ' + _imports_0 + '2x, ' + _imports_0 + '3x'
-export default function render() {
+export function render() {
const _ctx = this
return (openBlock(), createBlock(Fragment, null, [
createVNode(\\"img\\", {
expect(result.errors.length).toBe(0)
expect(result.source).toBe(source)
// should expose render fn
- expect(result.code).toMatch(`export default function render()`)
+ expect(result.code).toMatch(`export function render()`)
})
test('preprocess pug', () => {