底部默认不展开

master
许宏杰 3 weeks ago
parent 54e216e387
commit e9bc411828

@ -28,5 +28,6 @@ const getters = {
queryParamsXiaoqu: (state) => state.xiaoqu.queryParmas,
mapParmas: (state) => state.xiaoqu.mapParmas,
netWorkintroduce: (state) => state.xiaoqu.netWorkintroduce,
bottomPanel: (state) => state.xiaoqu.bottomPanel,
};
export default getters;

@ -7,13 +7,18 @@ const xiaoqu = {
networkName: undefined,
},
netWorkintroduce: {},
bottomPanel: false,
},
mutations: {
SET_PANEL: (state, boolean) => {
state.bottomPanel = !boolean;
},
//参数变化
CHANGE_QUERY: (state, query) => {
for (let key in query) {
state.queryParmas[key] = query[key];
}
if (!query.xiaoquId) state.bottomPanel = false;
},
CHANGE_QUERY_MAP: (state, query) => {
for (let key in query) {
@ -25,6 +30,7 @@ const xiaoqu = {
},
//重置参数
RESET_QUERY: (state, query) => {
state.bottomPanel = true;
state.netWorkintroduce = {
intro: "",
list: [],

@ -4,14 +4,14 @@
<div class="fold-btn" @click="togglePanel()">
<img
:src="
isCollapsed
bottomPanel
? require('@/assets/images/ui/arrow_left.jpg')
: require('@/assets/images/ui/arrow_right.jpg')
"
alt=""
/>
</div>
<div :class="['panel-main', { collapsed: isCollapsed }]">
<div :class="['panel-main', { collapsed: bottomPanel }]">
<slot></slot>
</div>
</div>
@ -19,15 +19,18 @@
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {
isCollapsed: false,
};
return {};
},
computed: {
...mapGetters(["bottomPanel"]),
},
methods: {
togglePanel() {
this.isCollapsed = !this.isCollapsed;
this.$store.commit("SET_PANEL", this.bottomPanel);
},
},
};

@ -81,7 +81,6 @@ export default {
},
methods: {
changeColor(e) {
console.log(e);
this.$store.commit("CHANGE_QUERY", {
color: e.length > 0 ? e.toString() : undefined,
});

Loading…
Cancel
Save