Commit 71c8d267 by 冒粤蓉

fix menu

1 parent b9bd1234
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"build": "vue-cli-service build" "build": "vue-cli-service build"
}, },
"dependencies": { "dependencies": {
"ant-design-vue": "^2.0.0-beta.10", "ant-design-vue": "^2.1.6",
"axios": "^0.20.0", "axios": "^0.20.0",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"less": "^3.12.2", "less": "^3.12.2",
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<ul class="ant-menu-sub ant-menu ant-menu-inline" <ul class="ant-menu-sub ant-menu ant-menu-inline"
v-if="item.showSubList" v-if="item.showSubList"
> >
<template v-for="cItem in item.children" <div v-for="cItem in item.children"
:key="cItem.origin.menuNo"> :key="cItem.origin.menuNo">
<!-- 三级菜单 --> <!-- 三级菜单 -->
<li v-if="cItem.children && cItem.children.length > 0" <li v-if="cItem.children && cItem.children.length > 0"
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
@click.stop="cItemClick(cItem.origin.frontRoute || '', cItem, item)"> @click.stop="cItemClick(cItem.origin.frontRoute || '', cItem, item)">
{{cItem.origin.menuName}} {{cItem.origin.menuName}}
</li> </li>
</template> </div>
</ul> </ul>
</li> </li>
</ul> </ul>
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
} }
const filterPath = (path) => { const filterPath = (path) => {
return path && (path.includes('system') || path.includes('monitor')) ? path : '/noData'; return path && (path.includes('system') || path.includes('monitor') || path.includes('oEshield')) ? path : '/noData';
} }
// 存储面包屑 // 存储面包屑
......
...@@ -9,6 +9,10 @@ ...@@ -9,6 +9,10 @@
/> />
<menu-fold-outlined v-else class="trigger" @click="clickCollapsed" /> <menu-fold-outlined v-else class="trigger" @click="clickCollapsed" />
<!-- <a-button type="primary" class="trigger">
<menu-unfold-outlined v-if="collapsed" />
<menu-fold-outlined v-else />
</a-button> -->
</div> </div>
<!-- <h3>主应用Vue数据:{{commonData}}</h3> <!-- <h3>主应用Vue数据:{{commonData}}</h3>
<button @click="minus">点击逐减Vue</button> <button @click="minus">点击逐减Vue</button>
...@@ -55,7 +59,7 @@ export default { ...@@ -55,7 +59,7 @@ export default {
const state = reactive({ const state = reactive({
collapsed: false, collapsed: false,
commonData: store.getters.commonData.parent, commonData: store.getters.commonData.parent,
reactNum: 0 // reactNum: 0
}); });
const commonData = computed(() => store.getters.commonData.parent); const commonData = computed(() => store.getters.commonData.parent);
...@@ -65,25 +69,25 @@ export default { ...@@ -65,25 +69,25 @@ export default {
store.dispatch('app/setCollapsed', state.collapsed); store.dispatch('app/setCollapsed', state.collapsed);
}; };
const minus = () => { // const minus = () => {
state.commonData -= 1; // state.commonData -= 1;
console.log(store) // console.log(store)
store.dispatch('app/setCommonData', { parent: state.commonData }); // store.dispatch('app/setCommonData', { parent: state.commonData });
} // }
const add = () => { // const add = () => {
// 通知微应用数据发生变化 // // 通知微应用数据发生变化
state.reactNum += 1; // state.reactNum += 1;
actions.setGlobalState({ reactNum: state.reactNum }); // actions.setGlobalState({ reactNum: state.reactNum });
console.log(actions); // console.log(actions);
} // }
return { return {
...toRefs(state), ...toRefs(state),
clickCollapsed, clickCollapsed,
commonData, commonData
minus, // minus,
add // add
} }
} }
} }
......
import '@babel/polyfill'
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'
import router from './router' import router from './router'
...@@ -15,4 +17,4 @@ const app = createApp(App); ...@@ -15,4 +17,4 @@ const app = createApp(App);
app.use(store) app.use(store)
.use(router) .use(router)
.use(ant) .use(ant)
.mount('#app'); .mount('#app');
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,8 @@ import { ...@@ -12,7 +12,8 @@ import {
Dropdown, Dropdown,
Spin, Spin,
Breadcrumb, Breadcrumb,
Empty Empty,
Icon
} from "ant-design-vue"; } from "ant-design-vue";
const ant = { const ant = {
...@@ -36,6 +37,7 @@ const ant = { ...@@ -36,6 +37,7 @@ const ant = {
Vue.component(Spin.name, Spin); Vue.component(Spin.name, Spin);
Vue.component(Breadcrumb.name, Breadcrumb); Vue.component(Breadcrumb.name, Breadcrumb);
Vue.component(Empty.name, Empty); Vue.component(Empty.name, Empty);
Vue.component(Icon.name, Empty);
}, },
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!