import { mapGetters } from "vuex"; import "./index.scss"; export default { name: "cl-menu-slider", data() { return { visible: true }; }, computed: { ...mapGetters(["menuList", "menuCollapse", "browser"]) }, watch: { menuList() { this.visible = false; setTimeout(() => { this.visible = true; }, 0); } }, methods: { toView(url) { if (url != this.$route.path) { this.$router.push(url); } } }, render() { const fn = (list) => { return list .filter((e) => e.isShow) .map((e) => { let html = null; if (e.type == 0) { html = ( {fn(e.children)} ); } else { html = ( {e.name} ); } return html; }); }; let el = fn(this.menuList); return ( this.visible && (
{el}
) ); } };