fix(compiler-core): handle base-transition
This commit is contained in:
@@ -10,7 +10,8 @@ import {
|
||||
PORTAL,
|
||||
RESOLVE_DYNAMIC_COMPONENT,
|
||||
SUSPENSE,
|
||||
KEEP_ALIVE
|
||||
KEEP_ALIVE,
|
||||
BASE_TRANSITION
|
||||
} from '../../src/runtimeHelpers'
|
||||
import {
|
||||
CallExpression,
|
||||
@@ -356,6 +357,30 @@ describe('compiler: element transform', () => {
|
||||
assert(`KeepAlive`)
|
||||
})
|
||||
|
||||
test('should handle <BaseTransition>', () => {
|
||||
function assert(tag: string) {
|
||||
const { root, node } = parseWithElementTransform(
|
||||
`<${tag}><span /></${tag}>`
|
||||
)
|
||||
expect(root.components.length).toBe(0)
|
||||
expect(root.helpers).toContain(BASE_TRANSITION)
|
||||
expect(node.callee).toBe(CREATE_VNODE)
|
||||
expect(node.arguments).toMatchObject([
|
||||
BASE_TRANSITION,
|
||||
`null`,
|
||||
createObjectMatcher({
|
||||
default: {
|
||||
type: NodeTypes.JS_FUNCTION_EXPRESSION
|
||||
},
|
||||
_compiled: `[true]`
|
||||
})
|
||||
])
|
||||
}
|
||||
|
||||
assert(`base-transition`)
|
||||
assert(`BaseTransition`)
|
||||
})
|
||||
|
||||
test('error on v-bind with no argument', () => {
|
||||
const onError = jest.fn()
|
||||
parseWithElementTransform(`<div v-bind/>`, { onError })
|
||||
|
||||
Reference in New Issue
Block a user