refactor: use named export for compiled render function
This commit is contained in:
@@ -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 }),
|
||||
|
||||
@@ -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\\", {
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user