mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
Merge pull request #93 from hotlcc/develop-低版本浏览器兼容性
This commit is contained in:
@@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* 浏览器兼容性处理
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修复低版本Safari等浏览器数组不支持at函数的问题
|
||||||
|
*/
|
||||||
|
export function fixArrayAt() {
|
||||||
|
if (!Array.prototype.at) {
|
||||||
|
Array.prototype.at = function(index: number) {
|
||||||
|
if (index >= 0) {
|
||||||
|
return this[index]
|
||||||
|
} else {
|
||||||
|
return this[this.length + index]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import { useToast } from 'vue-toast-notification'
|
|||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import type { TransferHistory } from '@/api/types'
|
import type { TransferHistory } from '@/api/types'
|
||||||
import ReorganizeForm from '@/components/form/ReorganizeForm.vue'
|
import ReorganizeForm from '@/components/form/ReorganizeForm.vue'
|
||||||
|
import { fixArrayAt } from '@/@core/utils/compatibility'
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
@@ -304,6 +305,9 @@ const dropdownItems = ref([
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// 修复低版本Safari等浏览器数组不支持at函数的问题
|
||||||
|
fixArrayAt()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user