fix(测试计划): 修复测试计划报告safari浏览器js报错页面空白全局兼容

This commit is contained in:
xinxin.wu 2024-09-24 16:20:59 +08:00 committed by Craftsman
parent 5400338962
commit 6af4d8502d
3 changed files with 9 additions and 9 deletions

View File

@ -502,15 +502,6 @@
}); });
}); });
// safar10bject.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();
}); });

View File

@ -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);

View File

@ -0,0 +1,5 @@
export default function applyPolyfills() {
if (!Object.hasOwn) {
Object.hasOwn = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
}
}