getQueryString()

This commit is contained in:
魏啾
2024-08-03 16:09:47 +08:00
parent f2666346c8
commit 1dd800b854

View File

@@ -427,7 +427,14 @@
} }
}, },
methods: { methods: {
getQueryString(url, name) { //解码
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
var r = url.substr(1).match(reg)
if (r != null) {
return r[2]
}
return null;
},
/** /**
* socket初始化 * socket初始化
*/ */
@@ -870,11 +877,11 @@
const currentElement = this.topArr[this.leftIndex]; const currentElement = this.topArr[this.leftIndex];
const diff = lastElement - currentElement; const diff = lastElement - currentElement;
console.log(diff) console.log(diff)
if (diff > this.scrollHeight) { // if (diff > this.scrollHeight) {
this.leftIndex = (index < 0 ? 0 : index); this.leftIndex = (index < 0 ? 0 : index);
} else { // } else {
this.leftIndex = this.leftIndex // this.leftIndex = this.leftIndex
} // }
} }
}, },
/* 左侧导航点击 */ /* 左侧导航点击 */
@@ -883,7 +890,9 @@
scrollTop: this.topArr[index] - this.HeighT, scrollTop: this.topArr[index] - this.HeighT,
duration: 0 duration: 0
}); });
setTimeout(() => {
this.leftIndex = index this.leftIndex = index
}, 500)
} }
} }
} }