From: Che Guevara <836934184@qq.com>
Date: Mon, 27 Sep 2021 14:52:59 +0000 (+0800)
Subject: test(vue): add config.compilerOptions.isCustomElement test (#4682)
X-Git-Tag: v3.2.20~31
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d84d5ecdbdf709570122175d6565bb61fae877f2;p=thirdparty%2Fvuejs%2Fcore.git
test(vue): add config.compilerOptions.isCustomElement test (#4682)
---
diff --git a/packages/vue/__tests__/index.spec.ts b/packages/vue/__tests__/index.spec.ts
index 99e3a63a6a..a51c7fd97a 100644
--- a/packages/vue/__tests__/index.spec.ts
+++ b/packages/vue/__tests__/index.spec.ts
@@ -131,7 +131,7 @@ describe('compiler + runtime integration', () => {
).toHaveBeenWarned()
})
- it('should support custom element', () => {
+ it('should support custom element via config.isCustomElement (deprecated)', () => {
const app = createApp({
template: ''
})
@@ -141,6 +141,16 @@ describe('compiler + runtime integration', () => {
expect(container.innerHTML).toBe('')
})
+ it('should support custom element via config.compilerOptions.isCustomElement', () => {
+ const app = createApp({
+ template: ''
+ })
+ const container = document.createElement('div')
+ app.config.compilerOptions.isCustomElement = tag => tag === 'custom'
+ app.mount(container)
+ expect(container.innerHTML).toBe('')
+ })
+
it('should support using element innerHTML as template', () => {
const app = createApp({
data: () => ({