1
0

优化逻辑,切换内容前返回顶部

This commit is contained in:
2022-03-05 23:29:28 +08:00
parent 4ede8ec0f0
commit fbeb36bbd5

View File

@@ -248,6 +248,16 @@ export default {
/** 切换页面 */
changePage(categoryName, itemName) {
/** @type {HTMLElement} */
const el = this.$refs['contentWrapper'];
if (el) {
el.scrollTop = 0;
} else {
console.warn('找不到 content-wrapper 元素。');
}
this.$router.push({
name: 'Content',
params: {
@@ -255,6 +265,7 @@ export default {
name: itemName,
}
});
},
/**