|
|
@@ -30,16 +30,23 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { getNewsContent } from "@/api";
|
|
|
+
|
|
|
export default {
|
|
|
- props: ['id', 'newsData'],
|
|
|
+ props: ['id'],
|
|
|
data() {
|
|
|
return {
|
|
|
- newsItem: this.newsData || {}
|
|
|
+ newsItem: {}
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- console.log("Received id:", this.id);
|
|
|
- console.log("Received newsData:", this.newsItem);
|
|
|
+ // console.log("Received id:", this.id);
|
|
|
+ // console.log("Received newsData:", this.newsItem);
|
|
|
+ // /system/page/content/
|
|
|
+ getNewsContent(this.id).then((res) => {
|
|
|
+ // console.log("News content data:", res.data);
|
|
|
+ this.newsItem = res.data || {};
|
|
|
+ });
|
|
|
},
|
|
|
// 移除 stripHtmlTags 方法,因为不再需要清理 HTML 标签
|
|
|
};
|