页面内容

<component v-if="dynamicComponent" :is="dynamicComponent"></component>

js部分

computed:{
      dynamicComponent(){
        let filename = this.$store.state.settings.modelMenu
        if(filename){
          return ()=> Promise.resolve(require(`@/layout/components/${filename}`))
        }else{
          return ()=> Promise.resolve(require(`@/layout/components/vertical`))
        }
      }
    },

参考链接
https://blog.csdn.net/weixin_45114462/article/details/119614980

Logo

前往低代码交流专区

更多推荐