Search code examples
vue.jselement-ui

Add show/hide timeout ELement UI


I have submenu from element UI what i am trying to do is to set time for show and hide the links i tried this but it doesnt work:

<template>
  <div id="app" class="font-sans text-black min-h-screen bg-grey-dark p-24">
    <el-menu mode="horizontal">
      <el-submenu :showtimeout:"100" :hidetimeout:"100" index="2-4">
        <template slot="title">test4</template>
        <el-menu-item index="2-4-1">test1</el-menu-item>
        <el-menu-item index="2-4-2">test2</el-menu-item>
        <el-menu-item index="2-4-3">test3</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
import Vue from "vue";
import ElementUI from "element-ui";
Vue.use(ElementUI);
export default {
  name: "app",
  showTimeout: {
    type: Number,
    default: 300
  },
  hideTimeout: {
    type: Number,
    default: 300
  }
};
</script>

but it doesnt work, could any one tell me why didnt work?


Solution

  • You have a typo there. camelCase always translates to kebab-case when used as html tag attribute.

    <el-submenu :show-timeout="100" :hide-timeout="100" index="2-4">