diff --git a/docs/en-US/component/drawer.md b/docs/en-US/component/drawer.md index e1ffc7a209..8209f9f0e3 100644 --- a/docs/en-US/component/drawer.md +++ b/docs/en-US/component/drawer.md @@ -42,7 +42,7 @@ Since v-model is natively supported for all components, `visible.sync` has been Callout a temporary drawer, from multiple direction -:::demo You must set `model-value` for `Drawer` like `Dialog` does to control the visibility of `Drawer` itself, it's `boolean` type. `Drawer` has to parts: `title` & `body`, the `title` is a named slot, you can also set the title through attribute named `title`, default to an empty string, the `body` part is the main area of `Drawer`, which contains user defined content. When opening, `Drawer` expand itself from the **right corner to left** which size is **30%** of the browser window by default. You can change that default behavior by setting `direction` and `size` attribute. This show case also demonstrated how to use the `before-close` API, check the Attribute section for more detail +:::demo You must set `model-value` for `Drawer` like `Dialog` does to control the visibility of `Drawer` itself, it's `boolean` type. `Drawer` has three parts: `title` & `body` & `footer`, the `title` is a named slot, you can also set the title through attribute named `title`, default to an empty string, the `body` part is the main area of `Drawer`, which contains user defined content. When opening, `Drawer` expand itself from the **right corner to left** which size is **30%** of the browser window by default. You can change that default behavior by setting `direction` and `size` attribute. This show case also demonstrated how to use the `before-close` API, check the Attribute section for more detail drawer/basic-usage @@ -115,10 +115,11 @@ Drawer provides an API called `destroyOnClose`, which is a flag variable that in ## Drawer Slots -| Name | Description | -| ----- | -------------------- | -| — | Drawer's Content | -| title | Drawer Title Section | +| Name | Description | +| ------ | --------------------- | +| — | Drawer's Content | +| title | Drawer Title Section | +| footer | Drawer footer Section | ## Drawer Methods diff --git a/docs/examples/drawer/basic-usage.vue b/docs/examples/drawer/basic-usage.vue index dab9526cb8..3db8af23e4 100644 --- a/docs/examples/drawer/basic-usage.vue +++ b/docs/examples/drawer/basic-usage.vue @@ -9,6 +9,9 @@ open + + with footer + Hi, there! + + + + + diff --git a/packages/components/drawer/src/drawer.vue b/packages/components/drawer/src/drawer.vue index d41aaf9eb8..b4f79bad94 100644 --- a/packages/components/drawer/src/drawer.vue +++ b/packages/components/drawer/src/drawer.vue @@ -51,6 +51,9 @@ + diff --git a/packages/theme-chalk/src/drawer.scss b/packages/theme-chalk/src/drawer.scss index 3b9fdfc9a6..f545a3debc 100644 --- a/packages/theme-chalk/src/drawer.scss +++ b/packages/theme-chalk/src/drawer.scss @@ -45,6 +45,12 @@ $directions: rtl, ltr, ttb, btt; font-size: 1rem; } + @include e(footer) { + padding: var(--el-drawer-padding-primary); + padding-top: 10px; + text-align: right; + } + &__close-btn { border: none; cursor: pointer;