12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <template>
- <view class="content">
- <image src='../../static/top.png' class='goTop' v-if='status' @click="goTop"></image>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- floorstatus: false
- }
- },
- props: {
- status: Boolean,
- },
- methods: {
- //回到顶部
- goTop: function(e) { // 一键回到顶部
- if (uni.pageScrollTo) {
- uni.pageScrollTo({
- scrollTop: 0
- })
- } else {
- uni.showModal({
- title: '提示',
- content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
- })
- }
- },
- }
- }
- </script>
- <style>
- /* 返回顶部 */
- .goTop {
- height: 80rpx;
- width: 80rpx;
- position: fixed;
- bottom: 20%;
- background: rgba(0, 0, 0, .3);
- right: 30rpx;
- border-radius: 50%;
- z-index: 999;
- }
- </style>
|