Commit 53d03826 by 李新

modify 2021-06-01

2 parents 9d65e741 922fda2b
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="module-top-container"> <div class="module-top-container">
<div class="module-top-left"> <div class="module-top-left">
<span class="module-name">{{name}}</span> <span class="module-name">{{name}}</span>
<span v-if="!isTop" class="module-top-btn" @click="$emit('clickTop')">{{$t('home.top')}}</span> <span v-if="showTop" class="module-top-btn" @click="$emit('clickTop')">{{$t('home.top')}}</span>
</div> </div>
<div class="module-more"> <div class="module-more">
<span>{{$t('home.more')}}</span> <span>{{$t('home.more')}}</span>
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
name: { name: {
type: String, type: String,
}, },
isTop: { showTop: {
type: Boolean, type: Boolean,
}, },
dateText: { dateText: {
......
...@@ -28,9 +28,9 @@ export default { ...@@ -28,9 +28,9 @@ export default {
console.log(); console.log();
return { return {
modules: [ modules: [
{ type: '1', name: this.$t('home.disclosure'), dateText: this.$t('home.disclosureDate'), isTop: true }, { type: '1', name: this.$t('home.disclosure'), dateText: this.$t('home.disclosureDate'), showTop: false },
{ type: '2', name: this.$t('home.news'), dateText: this.$t('home.updateDate'), isTop: false }, { type: '2', name: this.$t('home.news'), dateText: this.$t('home.updateDate'), showTop: true },
{ type: '3', name: this.$t('home.registered'), dateText: this.$t('home.updateDate'), isTop: false } { type: '3', name: this.$t('home.registered'), dateText: this.$t('home.updateDate'), showTop: true }
] ]
}; };
}, },
...@@ -48,9 +48,9 @@ export default { ...@@ -48,9 +48,9 @@ export default {
handleTop (module) { handleTop (module) {
const modules = [] const modules = []
for (const item of this.modules) { for (const item of this.modules) {
const isTop = item.type == module.type const showTop = item.type != module.type
isTop ? modules.unshift(item) : modules.push(item) !showTop ? modules.unshift(item) : modules.push(item)
Object.assign(item, { isTop }) Object.assign(item, { showTop })
} }
this.modules = modules this.modules = modules
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!