70 lines
1.6 KiB
Vue
Raw Normal View History

2021-11-21 16:53:18 +08:00
<template>
<div class="property-group">
2024-12-10 10:34:27 +08:00
<CCSection :expand="!fold" :name="group.name" :expand-by-full-header="true" :auto-slot-header="true">
<template v-slot:header>
<div style="flex: 1"></div>
<i style="" @click.stop="onLog" class="print iconfont icon_print"></i>
</template>
<div>
<UiProp v-for="(item, index) in group.data" :key="index" :name="item.name" :value="item.value"> </UiProp>
2021-11-21 16:53:18 +08:00
</div>
2024-12-10 10:34:27 +08:00
</CCSection>
2021-11-21 16:53:18 +08:00
</div>
</template>
<script lang="ts">
2024-12-09 16:23:58 +08:00
import ccui from "@xuyanfeng/cc-ui";
import { defineComponent, PropType, ref } from "vue";
import Bus, { BusMsg } from "../bus";
2024-01-09 12:02:47 +08:00
import { Group } from "../data";
import UiProp from "./ui-prop.vue";
2024-12-10 10:34:27 +08:00
const { CCInput, CCSection, CCButton, CCInputNumber, CCSelect, CCCheckBox, CCColor } = ccui.components;
2024-01-09 12:02:47 +08:00
export default defineComponent({
2021-11-21 16:53:18 +08:00
name: "property-group",
2024-01-09 15:33:34 +08:00
components: {
UiProp,
2024-12-10 10:34:27 +08:00
CCSection,
2024-01-09 15:33:34 +08:00
CCInput,
CCButton,
CCInputNumber,
CCSelect,
CCCheckBox,
CCColor,
},
2024-01-09 12:02:47 +08:00
props: {
group: {
type: Object as PropType<Group>,
default: () => {
return new Group("test");
},
},
},
setup(props, context) {
Bus.on(BusMsg.FoldAllGroup, (b: boolean) => {
fold.value = b;
});
const fold = ref(false);
return {
fold,
onLog() {
Bus.emit(BusMsg.LogData, [props.group.id]);
},
};
},
});
2021-11-21 16:53:18 +08:00
</script>
<style scoped lang="less">
.property-group {
2024-12-10 10:34:27 +08:00
.print {
margin-right: 10px;
&:hover {
color: #ffffff;
}
&:active {
color: #ffaa00;
}
2021-11-21 16:53:18 +08:00
}
}
</style>