Commit 922fda2b by amateur

组件调整

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