36 lines
562 B
Vue
36 lines
562 B
Vue
|
<template>
|
||
|
<!-- <component :is="activeName" />-->
|
||
|
<div>
|
||
|
<List v-show="activeName==='List'" ref="list"/>
|
||
|
<Detail v-if="activeName==='Detail'"/>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import List from './list.vue'
|
||
|
import Detail from './components/detail'
|
||
|
|
||
|
export default {
|
||
|
components: {
|
||
|
List: List,
|
||
|
Detail: Detail
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
activeName: 'List',
|
||
|
hiddenId: ''
|
||
|
}
|
||
|
},
|
||
|
watch: {
|
||
|
activeName(val) {
|
||
|
if (val === 'List') {
|
||
|
this.$refs.list.getList()
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
</style>
|