this.scrollTop = this.$refs.container.scrollTop this.updateVisibleItems() }, }, mounted() { this.containerHeight = this.$refs.container.clientHeight this.updateVisibleItems() this.$refs.container.addEventListener('scroll', this.onScroll) }, beforeDestroy() { this.$refs.container.removeEventListe...
this.container.addEventListener('scroll', this.onScroll.bind(this)); // 初始渲染 this.render(); } onScroll() { this.scrollTop = this.container.scrollTop; this.render(); } render() { // 计算可见区域的起始索引 this.startIndex = Math.floor(this.scrollTop / this.rowHeight); const endIn...
aria-label="Scroll To Top" type="button" onClick={handleScrollTop} className="p-2 text-gray-500 transition-all bg-gray-200 rounded-full dark:text-gray-400 dark:bg-gray-700 dark:hover:bg-gray-600 hover:bg-gray-300" className="rounded-full bg-gray-200 p-2 text-gray-500 transition-...
<svg className="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> <path fillRule="evenodd" d="M3.293 9.707a1 1 0 010-1.414l6-6a1 1 0 011.414 0l6 6a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L4.707 9.707a1 1 0 01-1.414 0z" clipRule="evenodd" /> </...
bg-center bg-top bg-bottom bg-left bg-left-top bg-left-bottom bg-right bg-right-top bg-right-bottom attachment bg-fixed bg-local bg-scroll 渐变:bg-gradient-to-[direct] from-[color]-[shade] to-[color]-[shade] 阴影 Consectetur velit laboris tempor laboris qui consequat eu minim i...
可以滚动的高度letscrollHeight=document.body.scrollHeight-window.innerHeightif(scrollHeight){setProgress(Number((currentScrollY/scrollHeight).toFixed(2))*100)}}// 添加全局滚动事件的监听window.addEventListener('scroll',updateScroll)// 移除监听return()=>{window.removeEventListener('scroll',updateScroll)...
seen scale on large teams. It’s easy to customize, adapts to any design, and the build size is tiny. container:标记为容器 mx-auto:x 轴方向(横向)上,外边距(margin)自动 外边距:m?-[number] m?:m-Margin、mt-MarginTop、ml-MarginLeft、mr-MarginRight、mb-MarginBottom number=number*...
seen scale on large teams. It’s easy to customize, adapts to any design, and the build size is tiny. container:标记为容器 mx-auto:x 轴方向(横向)上,外边距(margin)自动 外边距:m?-[number] m?:m-Margin、mt-MarginTop、ml-MarginLeft、mr-MarginRight、mb-MarginBottom number=number*...
objectPosition The object-position utilities like object-left-top opacity The opacity utilities like opacity-50 order The order utilities like order-8 outline The outline utilities like outline-white overflow The overflow utilities like overflow-y-auto overscrollBehavior The overscroll-behavior utilities ...
-- 菜单展开效果 -->展开菜单<arel="nofollow"href="#"class="block px-4 py-2 hover:bg-gray-100">菜单项 1<arel="nofollow"href="#"class="block px-4 py-2 hover:bg-gray-100">菜单项 2<arel="nofollow"href="#"class="block px-4 py-2 hover:...