We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v-bind=item
字符串出现次数最多字符获取
先递增后递减数组极大值获取
二分查找
// 例: [0,1,4,7,5] => 7 [1,6,5,3,2] => 6
实现粘性定位-快滑出屏幕时吸顶或吸底
axios 源码
// MDN 示例:在文档可见时开始播放音乐曲目,在文档不再可见时暂停音乐 document.addEventListener("visibilitychange", function () { if (document.visibilityState === "visible") { backgroundMusic.play(); } else { backgroundMusic.pause(); } });
// 省略若干代码 export default { props: { show: { type: Boolean, default: true, }, /** * 设置在mask上面滑动能不能滚动页面, 默认不能滚动页面 */ noScrollingPage: { type: Boolean, default: true, }, }, computed: { maskStyle() { return { position: "fixed", backgroundColor: `rgba(0,0,0, ${this.opacity})`, height: "100%", width: "100%", top: 0, left: 0, zIndex: getZIndex(), }; }, }, watch: { noScrollingPage(val) { val ? this.disableScrollPage() : this.enableScrollpage(); }, show(val) { val && this.noScrollingPage ? this.disableScrollPage() : this.enableScrollpage(); }, }, mounted() { this.$el.addEventListener("touchmove", this.scrollHander, true); this.show && this.noScrollingPage && this.disableScrollPage(); }, destroyed() { this.enableScrollpage(); this.$el.removeEventListener("touchmove", this.scrollHander); }, methods: { disableScrollPage() { document.documentElement.style.overflow = "hidden"; }, enableScrollpage() { document.documentElement.style.overflow = ""; }, scrollHander(e) { const getNeed = (el) => { if (el == this.$el || !el || !el.parentElement) { return false; } if (el.className.indexOf("mask-content-needscroll") >= 0) { return true; } return getNeed(el.parentElement); }; if (this.noScrollingPage && this.show && !getNeed(e.target)) { e.preventDefault(); } }, }, };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
常见问题
v-bind=item
https://cn.vuejs.org/v2/api/#v-bind代码评审高频问题
扩展
字符串出现次数最多字符获取
先递增后递减数组极大值获取
二分查找
实现粘性定位-快滑出屏幕时吸顶或吸底
axios 源码
补充
The text was updated successfully, but these errors were encountered: