fiee-official-website/src/views/news/size768/index.vue

49 lines
1.0 KiB
Vue
Raw Normal View History

2025-05-30 11:19:12 +00:00
<template>
2025-06-03 02:37:55 +00:00
<div class="page-container">
<div id="my-richText"></div>
2025-05-30 11:19:12 +00:00
</div>
</template>
<script setup>
2025-06-03 02:37:55 +00:00
import { reactive, onMounted } from "vue";
2025-05-30 11:19:12 +00:00
import { NSelect, NInput, NButton } from "naive-ui";
2025-06-03 02:37:55 +00:00
import { useI18n } from "vue-i18n";
2025-05-30 11:19:12 +00:00
const { t } = useI18n();
2025-06-03 02:37:55 +00:00
import { useRoute } from "vue-router";
const route = useRoute();
import axios from 'axios'
2025-05-30 11:19:12 +00:00
2025-06-03 02:37:55 +00:00
const state = reactive({
id: "", // 新闻id
2025-06-03 02:37:55 +00:00
});
onMounted(() => {
if (route.query.id) {
state.id = route.query.id;
2025-06-03 02:37:55 +00:00
}
getPressReleasesInfo();
2025-06-03 02:37:55 +00:00
});
//获取新闻信息
const getPressReleasesInfo = () => {
let url = 'https://common.szjixun.cn/api/pressreleases?id=' + state.id
axios.get(url).then((res) => {
// console.log(res)
if (res.status === 200) {
if (res.data.status === 0) {
const myRichText = document.getElementById('my-richText')
myRichText.innerHTML = res.data.data.content
}
}
})
}
2025-05-30 11:19:12 +00:00
</script>
<style scoped lang="scss">
.page-container {
2025-05-30 18:17:58 +00:00
max-width: calc(100% - 300px);
2025-05-30 11:19:12 +00:00
margin: 0 auto;
2025-05-30 18:17:58 +00:00
padding: 20px;
2025-05-30 11:19:12 +00:00
}
</style>