refactor: use named export for compiled render function

This commit is contained in:
Evan You
2019-12-24 10:51:26 -05:00
parent 4d20981eb0
commit 59c595c1e8
10 changed files with 21 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ import _imports_0 from '@svg/file.svg'
const _hoisted_1 = _imports_0 + '#fragment'
export default function render() {
export function render() {
const _ctx = this
return (openBlock(), createBlock(\\"use\\", { href: _hoisted_1 }))
}"
@@ -16,7 +16,7 @@ export default function render() {
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: '' }))
}"
@@ -28,7 +28,7 @@ import _imports_0 from './logo.png'
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 }),

View File

@@ -13,7 +13,7 @@ const _hoisted_5 = _imports_0 + '2x, ' + _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\\", {

View File

@@ -9,7 +9,7 @@ test('should work', () => {
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', () => {