Files
FirstUI-vue/pages/component/expand/backtop/backtop.vue
2023-08-17 21:28:49 +08:00

71 lines
2.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--本文件由FirstUI授权予新疆天衡创新研究院有限公司手机号 1 8 6 1407 25 49身份证尾号5A07X5专用请尊重知识产权勿私下传播违者追究法律责任-->
<template>
<view class="fui-wrap">
<view class="fui-page__hd">
<view class="fui-page__title fui-align__center" @tap="vip">Backtop <image
src="/static/images/index/light/icon_member_3x.png"></image>
</view>
<view class="fui-page__desc">Backtop 回到顶部返回页面顶部的操作按钮滑动页面查看效果</view>
</view>
<view class="fui-page__bd">
<fui-button type="gray" btn-size="medium" text="默认样式" bold :margin="['24rpx']"
@click="onChange(1)"></fui-button>
<fui-button type="gray" btn-size="medium" text="修改图标" bold @click="onChange(2)">
</fui-button>
<fui-button type="gray" btn-size="medium" text="调整样式" bold :margin="['24rpx']"
@click="onChange(3)">
</fui-button>
</view>
<fui-backtop :scrollTop="scrollTop" :name="name" :background="background" :color="color"></fui-backtop>
<!-- 自定义图标 设置custom 属性为true然后在插槽内放置图标-->
<!-- <fui-backtop custom :scrollTop="scrollTop">
<fui-icon name="up" :size="52"></fui-icon>
</fui-backtop> -->
<view style="width: 2px;height: 1000px;"></view>
</view>
</template>
<script>
export default {
data() {
return {
name: 'top',
background: '#FFFFFF',
color: '#333333',
scrollTop: 0
}
},
methods: {
vip() {
this.fui.href("/pages/my/qa/qa?index=2&title=VIP专属内容")
},
onChange(type) {
if (type == 1) {
this.name = 'top'
this.background = '#FFFFFF'
this.color = '#333333'
} else if (type == 2) {
this.name = 'turningup'
} else {
this.background = '#465CFF'
this.color = '#FFFFFF'
}
}
},
onPageScroll(e) {
this.scrollTop = e.scrollTop
}
}
</script>
<style>
.fui-page__bd {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
</style>