style(layout): createElement 方法简写为 h

This commit is contained in:
FairyEver
2020-04-21 15:52:37 +08:00
parent 08b72e4e6a
commit 145afb45b6
3 changed files with 30 additions and 30 deletions

View File

@@ -8,17 +8,17 @@ export default {
mixins: [
menuMixin
],
render (createElement) {
return createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-side' } }, [
createElement('el-menu', {
render (h) {
return h('div', { attrs: { class: 'd2-layout-header-aside-menu-side' } }, [
h('el-menu', {
props: { collapse: this.asideCollapse, uniqueOpened: true, defaultActive: this.$route.fullPath },
ref: 'menu',
on: { select: this.handleMenuSelect }
}, this.aside.map(menu => (menu.children === undefined ? elMenuItem : elSubmenu).call(this, createElement, menu))),
}, this.aside.map(menu => (menu.children === undefined ? elMenuItem : elSubmenu).call(this, h, menu))),
...this.aside.length === 0 && !this.asideCollapse ? [
createElement('div', { attrs: { class: 'd2-layout-header-aside-menu-empty', flex: 'dir:top main:center cross:center' } }, [
createElement('d2-icon', { props: { name: 'inbox' } }),
createElement('span', {}, '没有侧栏菜单')
h('div', { attrs: { class: 'd2-layout-header-aside-menu-empty', flex: 'dir:top main:center cross:center' } }, [
h('d2-icon', { props: { name: 'inbox' } }),
h('span', {}, '没有侧栏菜单')
])
] : []
])