标签:removes storage tab 行存储 返回值 set 取出 name sel
点击table tr项后,页面跳转到下级页面,返回回显搜索条件、当前页码、并将点击项select选中、滚动条也被记录回显跳转时滚动的位置
思路:
data(){
return {
}
}
setSessionStore (name, content) {
if (!name) return
if (typeof content !== 'string') {
content = JSON.stringify(content)
}
window.sessionStorage.setItem(name, content)
},
getSessionStore (name) {
if (!name) return;
var content = window.sessionStorage.getItem(name);
if (typeof content == 'string') {
content = JSON.parse(content)
}
return content;
},
removeSessionStore (name) {
if (!name) return
return window.sessionStorage.removeItem(name)
}
Vue -- element-ui el-table 点击tr项页面跳转,返回后缓存回显点击项
标签:removes storage tab 行存储 返回值 set 取出 name sel
原文地址:https://www.cnblogs.com/lisaShare/p/11025872.html