初始
This commit is contained in:
1
node_modules/@vant/weapp/dist/index-anchor/index.d.ts
generated
vendored
Normal file
1
node_modules/@vant/weapp/dist/index-anchor/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
25
node_modules/@vant/weapp/dist/index-anchor/index.js
generated
vendored
Normal file
25
node_modules/@vant/weapp/dist/index-anchor/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { getRect } from '../common/utils';
|
||||
import { VantComponent } from '../common/component';
|
||||
import { useParent } from '../common/relation';
|
||||
VantComponent({
|
||||
relation: useParent('index-bar'),
|
||||
props: {
|
||||
useSlot: Boolean,
|
||||
index: null,
|
||||
},
|
||||
data: {
|
||||
active: false,
|
||||
wrapperStyle: '',
|
||||
anchorStyle: '',
|
||||
},
|
||||
methods: {
|
||||
scrollIntoView(scrollTop) {
|
||||
getRect(this, '.van-index-anchor-wrapper').then((rect) => {
|
||||
wx.pageScrollTo({
|
||||
duration: 0,
|
||||
scrollTop: scrollTop + rect.top - this.parent.data.stickyOffsetTop,
|
||||
});
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
3
node_modules/@vant/weapp/dist/index-anchor/index.json
generated
vendored
Normal file
3
node_modules/@vant/weapp/dist/index-anchor/index.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"component": true
|
||||
}
|
||||
14
node_modules/@vant/weapp/dist/index-anchor/index.wxml
generated
vendored
Normal file
14
node_modules/@vant/weapp/dist/index-anchor/index.wxml
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<view
|
||||
class="van-index-anchor-wrapper"
|
||||
style="{{ wrapperStyle }}"
|
||||
>
|
||||
<view
|
||||
class="van-index-anchor {{ active ? 'van-index-anchor--active van-hairline--bottom' : '' }}"
|
||||
style="{{ anchorStyle }}"
|
||||
>
|
||||
<slot wx:if="{{ useSlot }}"/>
|
||||
<block wx:else>
|
||||
<text>{{ index }}</text>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
1
node_modules/@vant/weapp/dist/index-anchor/index.wxss
generated
vendored
Normal file
1
node_modules/@vant/weapp/dist/index-anchor/index.wxss
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-index-anchor{background-color:var(--index-anchor-background-color,transparent);color:var(--index-anchor-text-color,#323233);font-size:var(--index-anchor-font-size,14px);font-weight:var(--index-anchor-font-weight,500);line-height:var(--index-anchor-line-height,32px);padding:var(--index-anchor-padding,0 16px)}.van-index-anchor--active{background-color:var(--index-anchor-active-background-color,#fff);color:var(--index-anchor-active-text-color,#07c160);left:0;right:0}
|
||||
Reference in New Issue
Block a user