|
@@ -1,19 +1,38 @@
|
|
|
<template>
|
|
|
<div class="center_in">
|
|
|
- <div class="card_btn center_in" :style="{ width: config.css.width + 'px', height: config.css.height + 'px' }">
|
|
|
+ <div class="card_btn center_in" :style="{ width: btndata.css.width + 'px', height: btndata.css.height + 'px' }">
|
|
|
<div class="bg_item_btn center_in">
|
|
|
- <el-icon :size="config.config.size" :color="config.css.iconColor">
|
|
|
+ <!-- <el-icon :size="config.config.size" :color="config.css.iconColor">
|
|
|
<BellFilled />
|
|
|
- </el-icon>
|
|
|
+ </el-icon> -->
|
|
|
+ <div class="icon_card_btn"
|
|
|
+ :style="{ width: btndata.config.size + 'px', height: btndata.config.size + 'px', }">
|
|
|
+ <el-image class="images_icon"
|
|
|
+ :style="{ width: btndata.config.size + 'px', height: btndata.config.size + 'px', left: '-' + btndata.config.size + 'px', filter: 'drop-shadow(' + btndata.config.size + 'px 0 0 ' + btndata.css.iconColor + ')' }"
|
|
|
+ :src="getAssetsImages(btndata.config.img)" fit="contain" />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div>{{ config.name }}</div>
|
|
|
+ <div>{{ btndata.name }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { defineProps } from "vue";
|
|
|
-defineProps(["config", "sendSon"])
|
|
|
+import { defineProps, watch, ref } from "vue";
|
|
|
+const props = defineProps(["config", "sendSon"])
|
|
|
+
|
|
|
+const btndata: any = ref({})
|
|
|
+function getAssetsImages(name) {
|
|
|
+ var arr = '../../assets/iconData/' + name + '.png'
|
|
|
+ return new URL(`${arr}`, import.meta.url).href;
|
|
|
+}
|
|
|
+
|
|
|
+watch(() => props.config, (newValue) => {
|
|
|
+ console.log(newValue, 889);
|
|
|
+ if (newValue) {
|
|
|
+ btndata.value = newValue
|
|
|
+ }
|
|
|
+}, { immediate: true, deep: true })
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -30,4 +49,16 @@ defineProps(["config", "sendSon"])
|
|
|
border-radius: 50%;
|
|
|
background-color: rgba(21, 140, 251, 0.1);
|
|
|
}
|
|
|
+
|
|
|
+.icon_card_btn {
|
|
|
+ overflow: hidden;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.images_icon {
|
|
|
+ position: relative;
|
|
|
+ // left: -30px;
|
|
|
+ // -webkit-filter: drop-shadow(30px 0 0 rgba(21, 140, 251, 1));
|
|
|
+ // filter: drop-shadow(30px 0 0 rgba(21, 140, 251, 1));
|
|
|
+}
|
|
|
</style>
|