Vue multi-page application, how to transfer objects across pages between different sub-components?

vue multi-page application, one vue object per page, how to pass object type parameters across pages between different sub-components?

Jan.08,2022

you can use vuex to transfer data between different components.


you can pass parameters using localstorage or cookie, and types can handle


1, ide/essentials/passing-props.html" rel=" nofollow noreferrer "> routed parameters
2, vuex
3, and store to localstorage or sessionstorage


.

you can also customize Listener:

class Listener {
    constructor () {
        this.callbacks = []
        this.events = {}
    }
    on (event, callback) {
        var eventPos = this.events[event]
        if (eventPos !== undefined) {
            this.callbacks[eventPos] = callback
        } else {
            this.events[event] = this.callbacks.length
            this.callbacks.push(callback)
        }
    }
    emit (event, res) {
        var eventPos = this.events[event]
        if (eventPos !== undefined) {
            if (this.callbacks[eventPos] instanceof Function) this.callbacks[eventPos](res)
        } else {
            console.error(` ${event}`)
        }
    }
}

export default new Listener()
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b42663-2c600.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b42663-2c600.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?