fix(测试计划): 修复测试计划报告safari浏览器js报错页面空白全局兼容
This commit is contained in:
parent
5400338962
commit
6af4d8502d
|
@ -502,15 +502,6 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 解决safar1浏览器对富文本0bject.has0wn兼容引发空白问题
|
|
||||||
function applyPolyfills() {
|
|
||||||
if (!Object.hasOwn) {
|
|
||||||
Object.hasOwn = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
applyPolyfills();
|
|
||||||
|
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
editor.value?.destroy();
|
editor.value?.destroy();
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,6 +19,10 @@ import localforage from 'localforage';
|
||||||
import VueDOMPurifyHTML from 'vue-dompurify-html';
|
import VueDOMPurifyHTML from 'vue-dompurify-html';
|
||||||
import { getDefaultLocale } from './api/modules/user';
|
import { getDefaultLocale } from './api/modules/user';
|
||||||
import useLocale from './locale/useLocale';
|
import useLocale from './locale/useLocale';
|
||||||
|
import applyPolyfills from '@/utils/polyfill';
|
||||||
|
|
||||||
|
// 局部兼容未生效,解决全局兼容富文本js源码报错导致,safari浏览器对富文本0bject.has0wn兼容引发空白问题
|
||||||
|
applyPolyfills();
|
||||||
|
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
export default function applyPolyfills() {
|
||||||
|
if (!Object.hasOwn) {
|
||||||
|
Object.hasOwn = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue