<template>
  <el-submenu :popper-append-to-body="false" v-bind="$attrs" v-on="$listeners">
    <template slot="title">
      <slot name="title"></slot>
    </template>
    <slot></slot>
  </el-submenu>
</template>
<script>
export default {
  name: "sh-submenu",
  methods: {
    mouseenter1() {
      aleret();
    },
  },

  methods: {
    paddingStyle() {
      if (this.rootMenu.mode !== "vertical") return {};

      let padding = 20;
      let parent = this.$parent;

      if (this.rootMenu.collapse) {
        padding = 20;
      } else {
        while (parent && parent.$options.componentName !== "ElMenu") {
          if (parent.$options.componentName === "ElSubmenu") {
            padding += 20;
          }
          parent = parent.$parent;
        }
      }
      return { paddingLeft: padding + "px" };
    },
  },
};
</script>