fuchengshen
2022-07-09 3a25c05b5ab837714f30469cdcb1e2a77d8d7f6c
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
  <a-button class="mars-button" v-bind="attrs">
    <template v-for="(comp, name) in slots" :key="name" v-slot:[name]>
      <component :is="comp" />
    </template>
  </a-button>
</template>
<script lang="ts">
import { useAttrs, useSlots, defineComponent } from "vue"
export default defineComponent({
  name: "mars-button",
  inheritAttrs: false,
  setup() {
    const attrs = useAttrs()
    const slots = useSlots()
    return {
      attrs,
      slots
    }
  }
})
</script>
<style lang="less" scoped>
// 按钮
.mars-button {
  font-size: 14px;
  background: @mars-primary-color-half;
  border: none;
  padding-left: 10px;
  padding-right: 10px;
  color: @mars-base-color;
  :deep(.mars-icon) {
    font-size: 18px !important;
    line-height: 18px;
    vertical-align: middle !important;
    padding-left: 2px;
    padding-right: 2px;
  }
}
.mars-button:not([disabled]) {
  &:hover {
    color: @mars-base-color;
    border-color: #89bceb;
    background: @mars-hover-btn-bg;
  }
  &:focus {
    color: @mars-base-color;
    border-color: #89bceb;
    background: @mars-click-btn-bg;
  }
}
.ant-btn:disabled {
  color: @mars-base-color;
  background: @mars-disable-btn-bg;
  &:hover {
    background: @mars-disable-btn-bg;
    color: @mars-base-color;
  }
}
</style>
<style lang="less">
.ant-btn-link {
  border: none !important;
  background: none !important;
  padding: 0;
  height: initial;
}
/* 小型 单击按钮 */
.small-btn {
  padding: 4px 5px;
}
</style>