summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/vue/src/components
diff options
context:
space:
mode:
authorxu ran <xuranyjy@chinamobile.com>2021-01-08 09:16:00 +0000
committerGerrit Code Review <gerrit@onap.org>2021-01-08 09:16:00 +0000
commitef6cdb416e078ba33c772299f79cca8680b1d703 (patch)
treea5d455025f25e2b13816af42c9b72a4ea4d381d5 /usecaseui-portal/vue/src/components
parent0356c8ae8394adbb28123ddf4e727fc5b64c8fef (diff)
parent5bead046179e8e00c2cc4681992a6ffe24e4b97e (diff)
Merge "feat: embedding vue framwork in angular" into newarc
Diffstat (limited to 'usecaseui-portal/vue/src/components')
-rw-r--r--usecaseui-portal/vue/src/components/common/Menu.vue57
1 files changed, 57 insertions, 0 deletions
diff --git a/usecaseui-portal/vue/src/components/common/Menu.vue b/usecaseui-portal/vue/src/components/common/Menu.vue
new file mode 100644
index 00000000..089ed3be
--- /dev/null
+++ b/usecaseui-portal/vue/src/components/common/Menu.vue
@@ -0,0 +1,57 @@
+<template>
+ <div class="menu">
+ <Menu theme="light" active-name="7" @on-select="seletMenu">
+ <div v-for="(item, index) in menuList" :key="index">
+ <Submenu :name="item.name" v-if="item.children.length!==0">
+ <template slot="title">
+ {{item.title}}
+ </template>
+ <MenuItem v-for="(val, index) in item.children" :key="index" :name="val.name">
+ {{val.title}}
+ </MenuItem>
+ </Submenu>
+ <MenuItem :name="item.name" v-else>{{item.title}}</MenuItem>
+ </div>
+ </Menu>
+ <br>
+ </div>
+</template>
+
+<script>
+import { menu } from "@/const/index.js"
+
+export default {
+ components: {
+ },
+ data () {
+ return {
+ menuList: menu.MENU_ITEM
+ }
+ },
+ created () {
+ console.log(this.menuList)
+ },
+ methods: {
+ seletMenu (name) {
+ let seletedItem = {}
+ for (let item of this.menuList) {
+ if (item.name === name) {
+ seletedItem = item
+ } else{
+ for (let val of item.children) {
+ if (val.name === name) {
+ seletedItem = val
+ }
+ }
+ }
+ }
+ console.log(seletedItem)
+ this.$router.push({path: seletedItem.path})
+ }
+ },
+};
+</script>
+
+<style lang="sass">
+
+</style> \ No newline at end of file