Blame view

src/components/RightToolbar/index.vue 1.32 KB
yuanshuhui authored
1
2
<template>
  <div class="top-right-btn">
yuanshuhui authored
3
4
5
6
7
8
9
10
11
12
13
14
    <el-row v-if="noSearch">
      <el-tooltip
        class="item"
        effect="dark"
        :content="showSearch ? '隐藏搜索' : '显示搜索'"
      >
        <el-button
          size="mini"
          circle
          icon="el-icon-search"
          @click="toggleSearch()"
        />
yuanshuhui authored
15
16
      </el-tooltip>
      <el-tooltip class="item" effect="dark" content="刷新" placement="top">
yuanshuhui authored
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
        <el-button
          size="mini"
          circle
          icon="el-icon-refresh"
          @click="refresh()"
        />
      </el-tooltip>
    </el-row>
    <el-row v-else>
      <el-tooltip class="item" effect="dark" content="刷新" placement="top">
        <el-button
          size="mini"
          circle
          icon="el-icon-refresh"
          @click="refresh()"
        />
yuanshuhui authored
33
34
35
36
37
38
39
40
      </el-tooltip>
    </el-row>
  </div>
</template>
<script>
export default {
  name: "RightToolbar",
  data() {
yuanshuhui authored
41
42
43
    return {
      show: this.noSearch,
    };
yuanshuhui authored
44
45
46
47
48
49
  },
  props: {
    showSearch: {
      type: Boolean,
      default: true,
    },
yuanshuhui authored
50
51
52
53
    noSearch: {
      type: Boolean,
      default: false,
    },
yuanshuhui authored
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  },

  methods: {
    //搜索
    toggleSearch() {
      this.$emit("update:showSearch", !this.showSearch);
    },
    //刷新
    refresh() {
      this.$emit("queryTable");
    },
  },
};
</script>