曹睿
4 天以前 c056874186f0e2520f575d3363c5497df089e984
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
<template>
  <view :class="['flex', 'items-center', 'justify-between', 'page', full ? 'mx-3' : '']">
    <view>
      <text class="title">{{ title }}</text>
    </view>
    <view v-if="hideAction" class="flex justify-center">
      <wd-button icon="file-add" :round="false" size="small" custom-class="add_btn" @click="action">
        新增
      </wd-button>
    </view>
    <slot v-else name="action"></slot>
  </view>
</template>
<script setup lang="ts">
defineProps({
  full: {
    type: Boolean,
    default: true,
  },
  title: String,
  hideAction: Boolean,
});
 
const emits = defineEmits(["action"]);
 
const action = () => {
  emits("action");
};
</script>
<style lang="scss" scoped>
.page {
  padding: 10px 0;
  .title {
    position: relative;
    margin-left: 10px;
  }
  .title::after {
    position: absolute;
    content: "";
    top: 4px;
    left: -10px;
    width: 4px;
    height: 16px;
    background: #0d867f;
    border-radius: 2px;
  }
  :deep() {
    .add_btn {
      border-radius: 4px;
    }
  }
}
</style>