export default {
    data() {
        return {
            info:{}
        }
    },
    beforeDestroy(){
        let saveKey = this.saveKey
        if( this.id || !saveKey) return;
        console.log("beforeDestroy", this.info )
        localStorage.setItem( saveKey, JSON.stringify(this.info ));
    },
    mounted(){
        let saveKey = this.saveKey
        
        if( this.id||!saveKey) return;
        let data = localStorage.getItem(saveKey)
        if( !data ) return;
        let info = JSON.parse( data )||{};
        console.log("mounted", saveKey, info )
        this.info = info;
    }
}