Commit 8499a687 by gyy

tag跟你

parent c85b40ee
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
</div> </div>
</div> </div>
<div class="y_default_start"> <div class="y_default_start">
<keep-alive>
<div class="main_left" :style="{height: clientHeight + 'px'}"> <div class="main_left" :style="{height: clientHeight + 'px'}">
<el-menu <el-menu
:default-active="$route.path" :router="isRoute" :default-active="$route.path" :router="isRoute"
...@@ -23,11 +22,10 @@ ...@@ -23,11 +22,10 @@
<i class="el-icon-location"></i> <i class="el-icon-location"></i>
<span>{{item.name}}</span> <span>{{item.name}}</span>
</template> </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-submenu>
</el-menu> </el-menu>
</div> </div>
</keep-alive>
<!-- 侧边栏结束 --> <!-- 侧边栏结束 -->
<div class="main_right" :style="{width: clientWidth + 'px'}"> <div class="main_right" :style="{width: clientWidth + 'px'}">
<div class="crumbs"> <div class="crumbs">
...@@ -51,13 +49,9 @@ ...@@ -51,13 +49,9 @@
</ul> </ul>
</div> </div>
<!--<nuxt class="content"/>--> <!--<nuxt class="content"/>-->
<keep-alive v-if="keepAlive === '1'"> <keep-alive include='managers'>
<router-view class="content"></router-view> <router-view class="content"></router-view>
</keep-alive> </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> </div>
</div> </div>
...@@ -88,8 +82,7 @@ export default { ...@@ -88,8 +82,7 @@ export default {
leftMenuList: [], leftMenuList: [],
isRoute: true, isRoute: true,
moveLength: 130, moveLength: 130,
moveNum: 0, moveNum: 0
keepAlive: '2'
} }
}, },
computed: { computed: {
...@@ -313,23 +306,8 @@ export default { ...@@ -313,23 +306,8 @@ export default {
this.moveNum -- this.moveNum --
let root = document.getElementsByClassName('crumbs_text')[0] let root = document.getElementsByClassName('crumbs_text')[0]
root.style.cssText = 'transform: translateX(' + this.moveLength * this.moveNum + 'px);' 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() { mounted() {
this.getClientHeight() this.getClientHeight()
if (YCookie.readLocalCookie('tabNow') === undefined || YCookie.readLocalCookie('tabNow') === '') { if (YCookie.readLocalCookie('tabNow') === undefined || YCookie.readLocalCookie('tabNow') === '') {
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
<script> <script>
import requestApi from '../../../../assets/js/requestApi.js' import requestApi from '../../../../assets/js/requestApi.js'
import YCookie from '../../../../assets/js/yCookie.js'
export default { export default {
name: 'aaa',
data() { data() {
return { return {
total: 80, total: 80,
...@@ -53,14 +53,17 @@ export default { ...@@ -53,14 +53,17 @@ export default {
this.$router.push({ this.$router.push({
path: 'detail' path: 'detail'
}) })
YCookie.setLocalCookie('keepAlive', '1')
console.log('1111111111111111111111111')
console.log(YCookie.readLocalCookie('keepAlive'))
} }
}, },
mounted() { mounted() {
this.getList() this.getList()
console.log('00') console.log('00')
},
activated() {
this.pagination.page = 1
this.pagination.size = 10
this.getList()
console.log('------')
} }
} }
</script> </script>
......
...@@ -5,22 +5,11 @@ ...@@ -5,22 +5,11 @@
</template> </template>
<script> <script>
import YCookie from '../../../assets/js/yCookie.js'
export default { export default {
data() { data() {
return {} return {}
}, },
methods: { 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> </script>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<script> <script>
import page from './components/page.vue' import page from './components/page.vue'
export default { export default {
name: 'managers',
components: { components: {
page 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