Commit f962550e by 前端

对练

1 parent d64ddbab
<!-- ai对练 对练记录和任务列表 --> <!-- ai对练 对练记录和任务列表 -->
<template> <template>
<div class="in-exerciseTab-list-wrap"> <div class="in-exerciseTab-list-wrap">
<div class="header" slot="header" style="background: #e7eaec"> <div class="header" slot="header" style="background: #e7eaec">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane <el-tab-pane
v-for="(item, index) in tabPaneList" v-for="(item, index) in tabPaneList"
:label="item.label" :label="item.label"
:name="item.name" :name="item.name"
:key="index" :key="index"
> >
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<components :is="tabName" :scene-type="activeName"></components> <components :is="tabName" :scene-type="activeName"></components>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import index from "./index.vue" import index from "./index.vue"
import exerciseRecord from "./exerciseRecord.vue" import exerciseRecord from "./exerciseRecord.vue"
export default { import exerciseDetail from "./exerciseDetail.vue"
name: "exerciseTab", export default {
components: { name: "exerciseTab",
exerciseRecord, components: {
exerciseTask: index exerciseRecord,
}, exerciseDetail,
data() { exerciseTask: index
return { },
activeName: "0", data() {
tabPaneList: [ return {
{ activeName: "0",
label: "对练记录", tabPaneList: [
name: "0" {
}, label: "对练记录",
{ name: "0"
label: "任务列表", },
name: "1" {
} label: "任务列表",
], name: "1"
// tabName: "exerciseTask" },
tabName: "exerciseRecord" {
} label: "对练明细",
}, name: "2"
mounted() { }
if (this.$route.query.tabPane) { ],
this.activeName = this.$route.query.tabPane // tabName: "exerciseTask"
this.tabName = this.$route.query.tabLabel tabName: "exerciseRecord"
} }
}, },
watch: {}, mounted() {
methods: { if (this.$route.query.tabPane) {
handleClick() { this.activeName = this.$route.query.tabPane
const arr = { this.tabName = this.$route.query.tabLabel
0: "exerciseRecord", }
1: "exerciseTask" },
} watch: {},
this.tabName = arr[+this.activeName] methods: {
this.$router.push({ handleClick() {
query: { const arr = {
...this.$route.query, 0: "exerciseRecord",
tabPane: this.activeName, 1: "exerciseTask",
tabLabel: this.tabName 2: "exerciseDetail"
} }
}) this.tabName = arr[+this.activeName]
// this.$route.query.tabPane = this.activeName this.$router.push({
// this.$route.query.tabLabel = this.tabName query: {
} ...this.$route.query,
} tabPane: this.activeName,
} tabLabel: this.tabName
</script> }
<style scoped lang="scss"> })
.in-exerciseTab-list-wrap { // this.$route.query.tabPane = this.activeName
padding: 0 24px; // this.$route.query.tabLabel = this.tabName
}
.header { }
::v-deep .el-tabs__header { }
margin: 0; </script>
padding: 0 20px; <style scoped lang="scss">
} .in-exerciseTab-list-wrap {
} padding: 0 24px;
}
</style> .header {
::v-deep .el-tabs__header {
margin: 0;
padding: 0 20px;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!