获得徽章 0
- windows 滚动条美化
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
width: 6px;
background: rgba(#101F1C, 0.1);
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}
::-webkit-scrollbar-thumb {
background-color: rgba(#101F1C, 0.5);
background-clip: padding-box;
min-height: 28px;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(#101F1C, 1);
}展开评论点赞 - vuex
问题描述: 页面刷新 store里的值没有了;
解决方案:再app.vue钟增加监听,对页面刷新重载进行监听,存取缓存钟
created(){
// 在页面加载时读取sessionStorage
if (sessionStorage.getItem('store')) {
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('store'))))
}
// 在页面刷新时将store保存到sessionStorage里
window.addEventListener('beforeunload', () => {
sessionStorage.setItem('store', JSON.stringify(this.$store.state))
})
}展开评论点赞 - ant design vue 表格设置序号列遇到了一个坑:
【问题描述:使用render:(text,record,index)=> `${index+1}`,序号不显示】
纳闷半天,原来ant design 和 ant design vue 还是有区别的,ant design 中是render,但是ant design vue中是customRender。
小伙伴们要注意了啊~~~展开评论点赞 - 【踩坑:keep-alive】
我为啥用keeo-alive:在列表页进入详情页再从详情页回到列表页,希望此时的列表页和走的时候是一样的。(不然会重新加载页面,之前的操作状态都消失了)
but、but
坑来了,几个详情页,就参数不变,来回切换时,不再触发created事件了,导致页面错误,解决方法:
不想要缓存keep-alive的页面,
1、在路由配置对应页面加上meta: {keepAlive: false}
2、<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
<router-view v-if="!$route.meta.keepAlive"></router-view展开评论点赞