|
@@ -1,11 +1,7 @@
|
|
|
<template>
|
|
|
<div class="bg-F5">
|
|
|
<div class="container">
|
|
|
- <tab
|
|
|
- class="tab"
|
|
|
- :titles="`${$t(`page.views.news.details.titles`)}`"
|
|
|
- :currIndex.sync="currIndex"
|
|
|
- />
|
|
|
+ <tab :titles="titles" :currIndex.sync="currIndex" />
|
|
|
<load-more
|
|
|
url="/interface/notice/getNoticeListAll"
|
|
|
:params="params"
|
|
@@ -37,20 +33,27 @@ import { Dateformat } from "@/utils";
|
|
|
@Component
|
|
|
export default class extends Vue {
|
|
|
@Prop(String) private index!: string;
|
|
|
- private currIndex: number = 0;
|
|
|
- private params: IAny | null = null;
|
|
|
-
|
|
|
- activated() {
|
|
|
- this.currIndex = Number(this.index) || 0;
|
|
|
- this.currIndexChange();
|
|
|
- }
|
|
|
- @Watch("currIndex")
|
|
|
- currIndexChange() {
|
|
|
+ private currIndex = 0;
|
|
|
+ @Watch("index", { immediate: true })
|
|
|
+ indexChange() {
|
|
|
+ this.currIndex = Number(this.index) | 0;
|
|
|
this.params = { noticeType: this.currIndex + 1 };
|
|
|
}
|
|
|
+
|
|
|
+ private params: IAny | null = null;
|
|
|
+
|
|
|
getDateformat(date: string, fmt: string) {
|
|
|
return Dateformat(date, fmt);
|
|
|
}
|
|
|
+
|
|
|
+ get titles() {
|
|
|
+ return `${this.$t("page.views.news.details.titles")}`
|
|
|
+ .split(",")
|
|
|
+ .map((title, i) => ({
|
|
|
+ title,
|
|
|
+ url: `/news/${i}`
|
|
|
+ }));
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|