💄 材料Wiki样式优化,支持分类筛选&查询

This commit is contained in:
目棃
2024-10-05 11:22:40 +08:00
parent f8b16c0f97
commit cc121d6f9f
4 changed files with 162 additions and 62 deletions

View File

@@ -9,7 +9,7 @@
<div class="twom-type">{{ props.data.type }}</div>
</div>
<div class="twom-bottom">
<div class="twom-desc">{{ parseDesc() }}</div>
<div class="twom-desc" v-html="parseHtmlText(props.data.description)" />
<div class="twom-source" v-if="props.data.source.length > 1">
<TwoSource :data="item" v-for="(item, index) in props.data.source" :key="index" />
</div>
@@ -25,6 +25,7 @@
<script setup lang="ts">
import { computed } from "vue";
import { parseHtmlText } from "../../utils/toolFunc.js";
import TOverlay from "../main/t-overlay.vue";
import TwoConvert from "./two-convert.vue";
@@ -41,25 +42,15 @@ const props = defineProps<TwoMaterialProps>();
const emits = defineEmits<TwoMaterialEmits>();
const visible = computed({
get() {
return props.modelValue;
},
set(value) {
emits("update:modelValue", value);
},
get: () => props.modelValue,
set: (val) => emits("update:modelValue", val),
});
const iconBg = computed(() => {
if (!props.data) return "url('/icon/bg/0-BGC.webp')";
return `url('/icon/bg/${props.data.star}-BGC.webp')`;
});
function parseDesc() {
if (!props.data) return "";
return props.data.description.replace(/\\n/g, "\n");
}
function onCancel() {
console.log(props.data);
visible.value = false;
}
</script>