|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div id="btn">
|
|
|
+ <div id="c-button">
|
|
|
<el-button type="primary" @click="toAdd()" v-if="isAdd">新增</el-button>
|
|
|
<el-button type="warning" v-if="isEdit">修改</el-button>
|
|
|
<el-button type="danger" v-if="isDel">删除</el-button>
|
|
@@ -7,19 +7,19 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
-import { toRefs } from 'vue';
|
|
|
+import { toRefs } from 'vue'
|
|
|
const props = defineProps({
|
|
|
isAdd: { type: Boolean, default: () => true },
|
|
|
isEdit: { type: Boolean, default: () => false },
|
|
|
isDel: { type: Boolean, default: () => false },
|
|
|
isExport: { type: Boolean, default: () => false }
|
|
|
-});
|
|
|
-const { isAdd } = toRefs(props);
|
|
|
-const emit = defineEmits(['toAdd', 'toExport']);
|
|
|
+})
|
|
|
+const { isAdd } = toRefs(props)
|
|
|
+const emit = defineEmits(['toAdd', 'toExport'])
|
|
|
const toAdd = () => {
|
|
|
- emit('toAdd');
|
|
|
-};
|
|
|
+ emit('toAdd')
|
|
|
+}
|
|
|
const toExport = () => {
|
|
|
- emit('toExport');
|
|
|
-};
|
|
|
+ emit('toExport')
|
|
|
+}
|
|
|
</script>
|