From f8832dde5d721c10d518090874552e49003975b9 Mon Sep 17 00:00:00 2001 From: Jiajun Chen Date: Mon, 26 Aug 2019 10:44:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(drawer):=20make=20header=20slot=20to=20be?= =?UTF-8?q?=20the=20content=20inside=20`` * test(drawer): update snapshots --- components/drawer/Drawer.vue | 10 ++-------- .../__test__/__snapshots__/Drawer.spec.js.snap | 15 +++------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/components/drawer/Drawer.vue b/components/drawer/Drawer.vue index 2ec8b0993..c56df872d 100644 --- a/components/drawer/Drawer.vue +++ b/components/drawer/Drawer.vue @@ -6,7 +6,7 @@ @MDCDrawer:opened="onOpened" >

- @@ -114,10 +110,8 @@ export default { } }, mounted () { - // the slots can only be accessible in nextTick + // to avoid error throw by focus trap this.$nextTick(function () { - // judge whether the slots have the header class - this.hasHeaderClass = this.$slots.header[0].elm.classList.contains('mdc-drawer__header') if (!this.mdcDrawer && (this.dismissible || this.modal)) { this.mdcDrawer = new MDCDrawer(this.$el) } }) }, diff --git a/components/drawer/__test__/__snapshots__/Drawer.spec.js.snap b/components/drawer/__test__/__snapshots__/Drawer.spec.js.snap index 37e1f91f2..4625678b1 100644 --- a/components/drawer/__test__/__snapshots__/Drawer.spec.js.snap +++ b/components/drawer/__test__/__snapshots__/Drawer.spec.js.snap @@ -2,28 +2,19 @@ exports[`Drawer should render as dismissible 1`] = ` `; exports[`Drawer should render as modal 1`] = ` `; exports[`Drawer should render with no prop 1`] = ` `;