Commit 8499a687 by gyy

tag跟你

parent c85b40ee
......@@ -11,7 +11,6 @@
</div>
</div>
<div class="y_default_start">
<keep-alive>
<div class="main_left" :style="{height: clientHeight + 'px'}">
<el-menu
:default-active="$route.path" :router="isRoute"
......@@ -23,11 +22,10 @@
<i class="el-icon-location"></i>
<span>{{item.name}}</span>
</template>
<el-menu-item @click="select(sub.path)" :class="$route.path===sub.path?'orderCtg_list_now':''" :index="sub.path" v-for="(sub, subIndex) in item.pageList">{{sub.name}}</el-menu-item>
<el-menu-item :class="$route.path===sub.path?'orderCtg_list_now':''" :index="sub.path" v-for="(sub, subIndex) in item.pageList">{{sub.name}}</el-menu-item>
</el-submenu>
</el-menu>
</div>
</keep-alive>
<!-- 侧边栏结束 -->
<div class="main_right" :style="{width: clientWidth + 'px'}">
<div class="crumbs">
......@@ -51,13 +49,9 @@
</ul>
</div>
<!--<nuxt class="content"/>-->
<keep-alive v-if="keepAlive === '1'">
<keep-alive include='managers'>
<router-view class="content"></router-view>
</keep-alive>
<router-view class="content1" v-if="keepAlive !== '1'"></router-view>
<!--<keep-alive>
<router-view class="content"></router-view>
</keep-alive>-->
</div>
</div>
</div>
......@@ -88,8 +82,7 @@ export default {
leftMenuList: [],
isRoute: true,
moveLength: 130,
moveNum: 0,
keepAlive: '2'
moveNum: 0
}
},
computed: {
......@@ -313,23 +306,8 @@ export default {
this.moveNum --
let root = document.getElementsByClassName('crumbs_text')[0]
root.style.cssText = 'transform: translateX(' + this.moveLength * this.moveNum + 'px);'
},
select(e) {
console.log(e)
if (e === '/sys/usr/managers') {
YCookie.setLocalCookie('keepAlive', '1')
} else {
YCookie.setLocalCookie('keepAlive', '2')
}
console.log(YCookie.readLocalCookie('keepAlive'))
console.log('aaaaaaaaaaaaaaa')
}
},
updated() {
this.keepAlive = YCookie.readLocalCookie('keepAlive')
console.log('-----------')
console.log(this.keepAlive)
},
mounted() {
this.getClientHeight()
if (YCookie.readLocalCookie('tabNow') === undefined || YCookie.readLocalCookie('tabNow') === '') {
......
......@@ -18,8 +18,8 @@
<script>
import requestApi from '../../../../assets/js/requestApi.js'
import YCookie from '../../../../assets/js/yCookie.js'
export default {
name: 'aaa',
data() {
return {
total: 80,
......@@ -53,14 +53,17 @@ export default {
this.$router.push({
path: 'detail'
})
YCookie.setLocalCookie('keepAlive', '1')
console.log('1111111111111111111111111')
console.log(YCookie.readLocalCookie('keepAlive'))
}
},
mounted() {
this.getList()
console.log('00')
},
activated() {
this.pagination.page = 1
this.pagination.size = 10
this.getList()
console.log('------')
}
}
</script>
......
......@@ -5,22 +5,11 @@
</template>
<script>
import YCookie from '../../../assets/js/yCookie.js'
export default {
data() {
return {}
},
methods: {
},
// 详情页面的beforeRouteLeave钩子函数
beforeRouteLeave(to, from, next) {
console.log(to.name)
if (to.name === 'sys-usr-managers') {
YCookie.setLocalCookie('keepAlive', '1')
console.log('详情页面的beforeRouteLeave钩子函数')
console.log(YCookie.readLocalCookie('keepAlive'))
}
next()
}
}
</script>
......
......@@ -10,6 +10,7 @@
<script>
import page from './components/page.vue'
export default {
name: 'managers',
components: {
page
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment