import {clone} from "@/utils/clone";

const tabsHook = {
    setItem: function (arr) {
        localStorage.setItem('tabs', JSON.stringify(arr))
    },
    getItem: function () {
        return clone(JSON.parse(localStorage.getItem('tabs') || '[]'))
    },
    getItemKey: function () {
        let data = this.getItem()
        let temp = []
        for (let i = 0; i < data.length; i++) {
            temp.push(JSON.stringify(data[i]))
        }
        return temp
    }
}
export default tabsHook
