test(vue): add config.compilerOptions.isCustomElement test (#4682)
This commit is contained in:
parent
3f5f98dcf5
commit
d84d5ecdbd
@ -131,7 +131,7 @@ describe('compiler + runtime integration', () => {
|
|||||||
).toHaveBeenWarned()
|
).toHaveBeenWarned()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should support custom element', () => {
|
it('should support custom element via config.isCustomElement (deprecated)', () => {
|
||||||
const app = createApp({
|
const app = createApp({
|
||||||
template: '<custom></custom>'
|
template: '<custom></custom>'
|
||||||
})
|
})
|
||||||
@ -141,6 +141,16 @@ describe('compiler + runtime integration', () => {
|
|||||||
expect(container.innerHTML).toBe('<custom></custom>')
|
expect(container.innerHTML).toBe('<custom></custom>')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should support custom element via config.compilerOptions.isCustomElement', () => {
|
||||||
|
const app = createApp({
|
||||||
|
template: '<custom></custom>'
|
||||||
|
})
|
||||||
|
const container = document.createElement('div')
|
||||||
|
app.config.compilerOptions.isCustomElement = tag => tag === 'custom'
|
||||||
|
app.mount(container)
|
||||||
|
expect(container.innerHTML).toBe('<custom></custom>')
|
||||||
|
})
|
||||||
|
|
||||||
it('should support using element innerHTML as template', () => {
|
it('should support using element innerHTML as template', () => {
|
||||||
const app = createApp({
|
const app = createApp({
|
||||||
data: () => ({
|
data: () => ({
|
||||||
|
Loading…
Reference in New Issue
Block a user