vue arco.design錨點(diǎn)Anchor使用方式
1.vue3使用a-anchor錨點(diǎn)
快速找到信息內(nèi)容在當(dāng)前頁面的位置
代碼如下(示例):
<template> <div class="agreement"> <div class="pane"> <div id="container" class="content"> <div id="basic"> <h1>Basic</h1> <div style="height: 600px"></div> </div> <div id="line-less"> <h1>LineLess Mode</h1> <div style="height: 600px"></div> </div> <div id="Lake"> <h1>StreamLake</h1> <div style="height: 600px"></div> </div> </div> <div class="title"> <a-anchor line-less :change-hash="false" scroll-container="#container"> <a-anchor-link href="#basic" rel="external nofollow" >Basic</a-anchor-link> <a-anchor-link href="#line-less" rel="external nofollow" >LineLess Mode</a-anchor-link> <a-anchor-link href="#Lake" rel="external nofollow" >StreamLake</a-anchor-link> </a-anchor> </div> </div> </div> </template>
<script lang='ts' setup> </script> <style lang='scss' scoped> .agreement { position: relative; width: 100%; height: 100%; overflow: hidden; .pane { display: flex; justify-content: space-between; margin: $margin; padding: $padding; height: calc(100% - 60px); background: $color-bg-box; .content { width: calc(100% - 250px - 32px); padding-right: 16px; height: 100%; overflow-y: auto; border-right: 1px solid $color-border; } .title { width: 250px; padding-left: 16px; } } } </style>
2.注意!注意!注意!
- change-hash 設(shè)置為false
- scroll-container 要指定滾動(dòng)容器
scroll-container="#container"
<div id="container" class="content">
3.效果圖
官網(wǎng):(https://arco.design/vue/component/anchor)
總結(jié)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
vue+django實(shí)現(xiàn)下載文件的示例
這篇文章主要介紹了vue+django實(shí)現(xiàn)下載文件的示例,幫助大家更好的理解和學(xué)習(xí)使用vue框架,感興趣的朋友可以了解下2021-03-03element ui 表格動(dòng)態(tài)列顯示空白bug 修復(fù)方法
今天小編就為大家分享一篇element ui 表格動(dòng)態(tài)列顯示空白bug 修復(fù)方法,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2018-09-09Vue的transition-group與Virtual Dom Diff算法的使用
這篇文章主要介紹了Vue的transition-group與Virtual Dom Diff算法的使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-12-12Vue3中使用vuedraggable拖拽實(shí)戰(zhàn)教程
這篇文章主要介紹了Vue3中使用vuedraggable拖拽實(shí)戰(zhàn)教程,文中通過示例介紹了vue3拖拽組件vuedraggable的使用demo,需要的朋友可以參考下2023-06-06vue報(bào)錯(cuò)"vue-cli-service‘不是內(nèi)部或外部命令,也不是...”的解決辦法
這篇文章主要介紹了vue報(bào)錯(cuò)"vue-cli-service‘不是內(nèi)部或外部命令,也不是...”的解決辦法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2023-01-01詳解在vue-cli項(xiàng)目下簡單使用mockjs模擬數(shù)據(jù)
這篇文章主要介紹了詳解在vue-cli項(xiàng)目下簡單使用mockjs模擬數(shù)據(jù),小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-10-10