fix: ensure customElements API ssr compatibility

fix #4129
This commit is contained in:
Evan You 2021-07-16 10:40:06 -04:00
parent eca4d7891a
commit de32cfa43e
12 changed files with 49 additions and 1 deletions

View File

@ -157,7 +157,11 @@ export const defineSSRCustomElement = ((options: any) => {
return defineCustomElement(options, hydrate)
}) as typeof defineCustomElement
export class VueElement extends HTMLElement {
const BaseClass = (typeof HTMLElement !== 'undefined'
? HTMLElement
: class {}) as typeof HTMLElement
export class VueElement extends BaseClass {
/**
* @internal
*/

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import {
createApp,
h,

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { createApp } from 'vue'
import { renderToString } from '../src/renderToString'

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { renderToString } from '../src/renderToString'
import {
createApp,

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { createApp, createVNode } from 'vue'
import { renderToString } from '../src/renderToString'

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { ssrInterpolate } from '../src/helpers/ssrInterpolate'
import { escapeHtml } from '@vue/shared'

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import {
ssrRenderAttrs,
ssrRenderClass,

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { ssrRenderList } from '../src/helpers/ssrRenderList'
describe('ssr: renderList', () => {

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { createApp, h, mergeProps, withCtx } from 'vue'
import { renderToString } from '../src/renderToString'
import { ssrRenderComponent, ssrRenderAttrs, ssrRenderSlot } from '../src'

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { createApp, h, Suspense } from 'vue'
import { renderToString } from '../src/renderToString'

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import { createApp, h, Teleport } from 'vue'
import { renderToString } from '../src/renderToString'
import { SSRContext } from '../src/render'

View File

@ -1,3 +1,7 @@
/**
* @jest-environment node
*/
import {
ssrRenderDynamicModel,
ssrGetDynamicModelProps