基于vue3.0和element-plus的组件库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

80 lines
1.9 KiB

<template>
<div class="search-row">
<div class="left">
<span class="title" v-if="title">{{ title }}</span>
<el-button :size="state.size.size" v-if="fresh" type="info" icon="Refresh" @click="emit('query')"> </el-button>
<el-button :size="state.size.size" v-if="add" type="primary" icon="Plus" @click="emit('add')"> 添加 </el-button>
<el-button :size="state.size.size" v-if="del" type="danger" icon="Delete" @click="emit('delete')"> 删除
</el-button>
<slot name="left"></slot>
</div>
<div class="query">
<slot></slot>
<el-button :size="state.size.size" v-if="query" type="primary" icon="Search" @click="emit('query')"> 查询
</el-button>
</div>
</div>
</template>
<script lang="ts" setup>
import { onMounted } from "vue";
import { useStore } from "vuex";
const { state } = useStore();
const prop = defineProps({
title: {
type: String,
default: null
},
fresh: {
type: Boolean,
default: true,
},
add: {
type: Boolean,
default: true,
},
del: {
type: Boolean,
default: true,
},
query: {
type: Boolean,
default: true,
},
});
const emit = defineEmits(["query", "add", "delete"]);
onMounted(() => { });
</script>
<style lang="scss" scoped>
//@import url(); 引入公共css类
.search-row {
padding: v-bind('state.size.searchRowPad');
background-color: v-bind('state.style.searchRowBg');
}
.query {
text-align: right;
float: right;
width: 50%;
}
.left {
float: left;
width: 50%;
}
.search-row,
.query,
.left {
height: v-bind('state.size.searchRowHeight');
}
.title {
font-weight: bold;
padding-right: 15px;
font-size: v-bind('state.size.titleSize');
min-width: 20px;
}
</style>