gaoluyang
3 天以前 d1448cb0ef10f358bb7bddb4e1ec268515e0b787
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<template>
  <view class="float-button">
    <u-button :type="type" :icon="icon" :shape="shape" :disabled="disabled" :size="size" @click="$emit('click')"></u-button>
  </view>
</template>
 
<script>
export default {
  props: {
    // 按钮的预置样式,info,primary,error,warning,success
    type: {
      type: String,
      default: uni.$u.props.button.type
    },
    // 图标
    icon: {
      type: String
    },
    // 按钮尺寸,large,normal,small,mini
    size: {
      type: String,
      default: 'large'
    },
    // 按钮形状,circle(两边为半圆),square(带圆角)
    shape: {
      type: String,
      default: 'circle'
    },
    // 按钮是否镂空
    plain: {
      type: Boolean,
      default: uni.$u.props.button.plain
    },
    // 是否禁止状态
    disabled: {
      type: Boolean,
      default: uni.$u.props.button.disabled
    },
  }
}
</script>
 
<style lang="scss" scoped>
.float-button {
  bottom: 100px;
  right: 20px;
  width: 52px;
  height: 52px;
  position: fixed;
  z-index: 10;
}
</style>