Browse Source

公司简介默认标题获取

master
aBin 3 years ago
parent
commit
f1a591bba2
  1. BIN
      dist.zip
  2. 16
      src/views/CompanyProfile/CompanyProfile.vue

BIN
dist.zip

Binary file not shown.

16
src/views/CompanyProfile/CompanyProfile.vue

@ -56,28 +56,32 @@ export default {
], ],
}, },
content: {}, content: {},
showLoading: true showLoading: true,
}; };
}, },
watch: { watch: {
'$route.query.code'(val) { '$route.query.code'(val) {
if (this.$route.path === this.list.url) { if (this.$route.path === this.list.url) {
this.code = val; this.code = val;
for (let i = 0; i < this.list.children.length; i++) { this.getDefaultTitle(val);
if (val === this.list.children[i].code) {
this.defaultTitle = this.list.children[i].title;
}
}
this.getData(this.code); this.getData(this.code);
} }
}, },
}, },
created() { created() {
this.code = this.$route.query.code; this.code = this.$route.query.code;
this.getDefaultTitle(this.code);
this.getData(this.code); this.getData(this.code);
}, },
methods: { methods: {
...mapActions('home', ['getDetail']), ...mapActions('home', ['getDetail']),
getDefaultTitle(code) {
for (let i = 0; i < this.list.children.length; i++) {
if (code === this.list.children[i].code) {
this.defaultTitle = this.list.children[i].title;
}
}
},
async getData(showPage) { async getData(showPage) {
try { try {
this.showLoading = true; this.showLoading = true;

Loading…
Cancel
Save