Commit 593252e6 authored by 赵伟庚's avatar 赵伟庚

[style](block-radius): 代码格式化

按照代码规范格式化代码
parent 4c101843
<template> <template>
<div class="block_radius"> <div class="block_radius">
<div class="right_cont"> <div class="right_cont">
<div v-if="show_header" class="block_header"> <div v-if="show_header" class="block_header">
<div class="icon_box"> <div class="icon_box">
<bg-icon style="font-size: 14px; color: #fff;" :icon="bgIcon"></bg-icon> <bg-icon style="font-size: 14px; color: #fff" :icon="bgIcon"></bg-icon>
</div> </div>
<div class="top_title">{{ title }}</div> <div class="top_title">{{ title }}</div>
<div v-if="selectArr.length > 0"> <div v-if="selectArr.length > 0">
<el-select <el-select @change="selectChange" v-model="currentSelectValue" placeholder="请选择">
@change="selectChange" <el-option v-for="item in selectArr" :key="item.value" :label="item.label" :value="item.value"> </el-option>
v-model="currentSelectValue"
placeholder="请选择"
>
<el-option
v-for="item in selectArr"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> </el-select>
</div> </div>
<div v-if="buttons_arr" class="block_header_button_group"> <div v-if="buttons_arr" class="block_header_button_group">
...@@ -29,8 +17,7 @@ ...@@ -29,8 +17,7 @@
:key="index" :key="index"
class="block_header_button" class="block_header_button"
:class="active_button == index ? 'active' : ''" :class="active_button == index ? 'active' : ''"
@click="changeButton(index)" @click="changeButton(index)">
>
{{ item }} {{ item }}
</div> </div>
</div> </div>
...@@ -42,10 +29,8 @@ ...@@ -42,10 +29,8 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { reactive, toRefs, onBeforeMount } from 'vue' import { reactive, toRefs, onBeforeMount } from "vue";
const props = defineProps({ const props = defineProps({
show_header: { show_header: {
...@@ -53,8 +38,8 @@ const props = defineProps({ ...@@ -53,8 +38,8 @@ const props = defineProps({
default: false, default: false,
}, },
selectValue: { selectValue: {
type: [String,Number], type: [String, Number],
default: "" default: "",
}, },
selectArr: { selectArr: {
type: Array, type: Array,
...@@ -70,7 +55,7 @@ const props = defineProps({ ...@@ -70,7 +55,7 @@ const props = defineProps({
}, },
bgIcon: { bgIcon: {
type: String, type: String,
default: "" default: "",
}, },
title: { title: {
type: String, type: String,
...@@ -78,42 +63,39 @@ const props = defineProps({ ...@@ -78,42 +63,39 @@ const props = defineProps({
}, },
background_color: { background_color: {
type: String, type: String,
default: "#fff" default: "#fff",
}, // header条背景色 }, // header条背景色
showLeft: { showLeft: {
type: Boolean, type: Boolean,
default: true default: true,
}, },
noPadding: { noPadding: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
}) });
const emit = defineEmits(['selectChange','changeButton']) const emit = defineEmits(["selectChange", "changeButton"]);
const state = reactive({ const state = reactive({
currentSelectValue: null, currentSelectValue: null,
active_button: 0 active_button: 0,
}) });
const selectChange = (val) => { const selectChange = (val) => {
state.currentSelectValue = val; state.currentSelectValue = val;
emit('selectChange', val); emit("selectChange", val);
} };
const changeButton = (index) => { const changeButton = (index) => {
if (state.active_button != index) { if (state.active_button != index) {
state.active_button = index; state.active_button = index;
emit("changeButton", index); emit("changeButton", index);
} }
} };
onBeforeMount(() => { onBeforeMount(() => {
state.currentSelectValue = props.selectValue state.currentSelectValue = props.selectValue;
}) });
const { const { currentSelectValue, active_button } = toRefs(state);
currentSelectValue,
active_button,
} = toRefs(state)
</script> </script>
<style scoped> <style scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment