“be93b0e8638287bfaa8239ef64ee1c4a7cd818cb”上不存在“git@gitcode.net:openharmony/third_party_openssl.git”
asyncSubmenu.vue 1.4 KB
Newer Older
Mr.奇淼('s avatar
Mr.奇淼( 已提交
1
<template>
2 3
  <el-sub-menu ref="subMenu" :index="routerInfo.name">
    <template #title>
4
      <el-icon v-if="routerInfo.meta.icon">
P
piexlmax 已提交
5 6
        <component :is="routerInfo.meta.icon" />
      </el-icon>
7
      <span>{{ routerInfo.meta.title }}</span>
Mr.奇淼('s avatar
Mr.奇淼( 已提交
8
    </template>
何秀钢 已提交
9
    <slot />
10
  </el-sub-menu>
Mr.奇淼('s avatar
Mr.奇淼( 已提交
11 12 13 14
</template>

<script>
export default {
Mr.奇淼('s avatar
Mr.奇淼( 已提交
15
  name: 'AsyncSubmenu',
Mr.奇淼('s avatar
Mr.奇淼( 已提交
16 17
}
</script>
18 19

<script setup>
Mr.奇淼('s avatar
Mr.奇淼( 已提交
20 21
import { ref, watch } from 'vue'
const props = defineProps({
22 23 24 25 26
  routerInfo: {
    default: function() {
      return null
    },
    type: Object
Mr.奇淼('s avatar
Mr.奇淼( 已提交
27 28 29 30 31 32 33 34 35 36 37 38
  },
  isCollapse: {
    default: function() {
      return false
    },
    type: Boolean
  },
  theme: {
    default: function() {
      return {}
    },
    type: Object
39 40
  }
})
Mr.奇淼('s avatar
Mr.奇淼( 已提交
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

// const activeBackground = ref(props.theme.activeBackground)
// const activeText = ref(props.theme.activeText)
const normalText = ref(props.theme.normalText)
// const hoverBackground = ref(props.theme.hoverBackground)
// const hoverText = ref(props.theme.hoverText)

watch(() => props.theme, () => {
  // activeBackground.value = props.theme.activeBackground
  // activeText.value = props.theme.activeText
  normalText.value = props.theme.normalText
  // hoverBackground.value = props.theme.hoverBackground
  // hoverText.value = props.theme.hoverText
})

56
</script>
Mr.奇淼('s avatar
Mr.奇淼( 已提交
57 58 59 60 61 62 63 64 65

<style lang="scss" scoped>
.el-sub-menu{
  ::v-deep(.el-sub-menu__title){
      color: v-bind(normalText);
  }
}

</style>