mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-03 13:38:11 +08:00
Compare commits
4 Commits
92d622aa82
...
2dcb4e39b1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dcb4e39b1 | ||
|
|
892e69a8a8 | ||
|
|
2ffdbcdef2 | ||
|
|
13629b2070 |
@ -172,6 +172,8 @@ export default {
|
||||
width: 100%;
|
||||
background-color: var(--van-doc-header-background);
|
||||
user-select: none;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
||||
&__top {
|
||||
display: flex;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="van-doc-nav" :style="style">
|
||||
<div :class="['van-doc-nav', { 'van-doc-nav-fixed': isFixed }]">
|
||||
<div
|
||||
v-for="(group, index) in navConfig"
|
||||
class="van-doc-nav__group"
|
||||
@ -38,19 +38,11 @@ export default {
|
||||
|
||||
data() {
|
||||
return {
|
||||
top: 64,
|
||||
bottom: 0,
|
||||
isFixed: false,
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
style() {
|
||||
return {
|
||||
top: this.top + 'px',
|
||||
bottom: this.bottom + 'px',
|
||||
};
|
||||
},
|
||||
|
||||
base() {
|
||||
return this.lang ? `/${this.lang}/` : '/';
|
||||
},
|
||||
@ -64,7 +56,7 @@ export default {
|
||||
methods: {
|
||||
onScroll() {
|
||||
const { pageYOffset: offset } = window;
|
||||
this.top = Math.max(0, 64 - offset);
|
||||
this.isFixed = offset > 64;
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -72,8 +64,10 @@ export default {
|
||||
|
||||
<style lang="less">
|
||||
.van-doc-nav {
|
||||
position: fixed;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: var(--van-doc-header-top-height);
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
min-width: var(--van-doc-nav-width);
|
||||
max-width: var(--van-doc-nav-width);
|
||||
@ -86,6 +80,10 @@ export default {
|
||||
margin-left: calc((var(--van-doc-row-max-width) / 2 * -1));
|
||||
}
|
||||
|
||||
&.van-doc-nav-fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
}
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
|
||||
@ -1,5 +1,9 @@
|
||||
## Changelog
|
||||
|
||||
## 2.0.1
|
||||
|
||||
- add woff format back to be compatible with some special webview
|
||||
|
||||
## 2.0.0
|
||||
|
||||
- no longer support woff/ttf format
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vant/icons",
|
||||
"version": "2.0.0",
|
||||
"version": "2.0.1",
|
||||
"description": "vant icons",
|
||||
"main": "./src/config.js",
|
||||
"types": "./src/config.d.ts",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -6,5 +6,7 @@
|
||||
font-display: auto;
|
||||
font-family: 'vant-icon';
|
||||
src: url('//at.alicdn.com/t/c/font_2553510_ovbl29ce9ud.woff2?t=1672541115585')
|
||||
format('woff2');
|
||||
format('woff2'),
|
||||
url('//at.alicdn.com/t/c/font_2553510_ovbl29ce9ud.woff?t=1672541115585')
|
||||
format('woff');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user