UnisKB/ui/src/views/paragraph/component/ParagraphCard.vue

51 lines
1010 B
Vue
Raw Normal View History

2025-06-06 08:32:03 +00:00
<template>
2025-06-06 12:08:15 +00:00
<el-card
shadow="hover"
class="paragraph-box cursor"
@mouseenter="cardEnter()"
@mouseleave="cardLeave()"
>
<h2 class="mb-16">{{ data.title || '-' }}</h2>
2025-06-06 08:32:03 +00:00
<MdPreview
ref="editorRef"
editorId="preview-only"
2025-06-06 12:08:15 +00:00
:modelValue="data.content"
2025-06-06 08:32:03 +00:00
class="maxkb-md"
/>
</el-card>
</template>
<script setup lang="ts">
import { ref, useSlots } from 'vue'
import { t } from '@/locales'
2025-06-06 12:08:15 +00:00
const props = defineProps<{
data: any
}>()
2025-06-06 08:32:03 +00:00
const show = ref(false)
// card上面存在dropdown菜单
const subHovered = ref(false)
function cardEnter() {
show.value = true
subHovered.value = false
}
function cardLeave() {
show.value = subHovered.value
}
function subHoveredEnter() {
subHovered.value = true
}
</script>
<style lang="scss" scoped>
2025-06-06 12:08:15 +00:00
.paragraph-box {
background: var(--app-layout-bg-color);
border: 1px solid #ffffff;
box-shadow: none !important;
&:hover {
background: rgba(31, 35, 41, 0.1);
border: 1px solid #dee0e3;
2025-06-06 08:32:03 +00:00
}
}
</style>