|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <n-card :title="title" class="notice-box">
|
|
|
+ <n-card :title="title" class="notice-box" @click="handleDetail">
|
|
|
{{ content }}
|
|
|
<template #footer>
|
|
|
{{ time }}
|
|
@@ -7,11 +7,17 @@
|
|
|
</n-card>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+const router = useRouter();
|
|
|
defineOptions({
|
|
|
name: "notice-box",
|
|
|
});
|
|
|
|
|
|
-defineProps({
|
|
|
+const props = defineProps({
|
|
|
+ id: {
|
|
|
+ type: [String, Number],
|
|
|
+ default: () => "",
|
|
|
+ },
|
|
|
title: {
|
|
|
type: String,
|
|
|
default: () => "",
|
|
@@ -25,6 +31,14 @@ defineProps({
|
|
|
default: () => "",
|
|
|
},
|
|
|
});
|
|
|
+
|
|
|
+const handleDetail = () => {
|
|
|
+ if (props.id) {
|
|
|
+ router.push("/info-detail/" + props.id);
|
|
|
+ } else {
|
|
|
+ console.warn("missing id");
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
@@ -36,6 +50,7 @@ defineProps({
|
|
|
// background-image: url("/img/notice_list_bg.png");
|
|
|
background-size: contain;
|
|
|
background-repeat: no-repeat;
|
|
|
+ cursor: pointer;
|
|
|
// background-color: transparent;
|
|
|
}
|
|
|
</style>
|