提交 c81ac5aa 编写于 作者: inkwalk's avatar inkwalk

remove vuex from top-window

上级 a04ef325
......@@ -12,7 +12,6 @@
</template>
<script>
import { mapMutations, mapState } from 'vuex'
export default {
data() {
return {
......@@ -38,20 +37,21 @@
}]
}
},
computed: {
...mapState({
active: state => state.active,
hasLeftWin: state => !state.noMatchLeftWindow
})
props: {
matchLeftWindow: {
type: Boolean
},
showLeftWindow: {
type: Boolean
}
},
watch: {
$route: {
immediate: true,
handler(newRoute) {
if ( this.hasLeftWin ) {
if ( this.showLeftWindow ) {
let comp = newRoute.path.split('/')[2]
this.current = this.selected[comp]
for(const item of this.indexPage) {
if (newRoute.path === item.tabBar) {
uni.redirectTo({
......@@ -66,16 +66,7 @@
mounted() {
},
methods: {
...mapMutations(['setActive']),
toSecondMenu(e) {
let component = e.pagePath.split('/')[3]
if (component === 'component') {
component = 'componentPage'
}
if (component === 'template') {
component = 'templatePage'
}
this.setActive(component)
const activeTabBar = '/' + e.pagePath
for(const item of this.indexPage) {
if (activeTabBar === item.tabBar) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册