From 7ef674bddea94095c5d25d2e9a7055c7dec2e815 Mon Sep 17 00:00:00 2001 From: winwin2011 Date: Fri, 17 Sep 2021 09:41:36 +0800 Subject: [PATCH] feat(web): h-button block --- .../src/components/HButton.stories.mdx | 46 +++++++++++-------- packages/hexon-web/src/components/HButton.vue | 10 +++- .../src/components/HIcon.stories.mdx | 12 ++--- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/packages/hexon-web/src/components/HButton.stories.mdx b/packages/hexon-web/src/components/HButton.stories.mdx index 0f960db4..d72bc23f 100644 --- a/packages/hexon-web/src/components/HButton.stories.mdx +++ b/packages/hexon-web/src/components/HButton.stories.mdx @@ -45,14 +45,16 @@ import HIcon from "./HIcon.vue"; `inverted?: boolean = false` - + {() => ({ components: { HButton }, template: ` +
primary  success  warning  error +
`, })}
@@ -66,17 +68,37 @@ import HIcon from "./HIcon.vue"; {() => ({ components: { HButton }, - template: ` `, + template: ` + + + + + + +`, + })} + +
+ +## 扩展的 + +`block?: boolean = false` + + + + {() => ({ + components: { HButton }, + template: `确定取消`, })} ## 图标 -使用 HIcon 或者 xicons 的 Icon +使用 [HIcon](?path=/docs/hicon--基础) 或者 [xicons](https://www.xicons.org/#/) 的 [Icon](https://github.com/07akioni/xicons#usage) - + {() => ({ components: { HButton, @@ -101,21 +123,7 @@ import HIcon from "./HIcon.vue"; - -`, - })} - - - {() => ({ - components: { - HButton, - HIcon, - Icon, - Search16Filled, - Add16Filled, - Edit16Filled, - }, - template: ` +  diff --git a/packages/hexon-web/src/components/HButton.vue b/packages/hexon-web/src/components/HButton.vue index 31932fa0..8ca804e5 100644 --- a/packages/hexon-web/src/components/HButton.vue +++ b/packages/hexon-web/src/components/HButton.vue @@ -1,5 +1,4 @@ @@ -56,6 +58,10 @@ button { user-select: none; text-decoration: none; overflow: hidden; + &.block { + display: flex; + width: 100%; + } &.round { width: 32px; } diff --git a/packages/hexon-web/src/components/HIcon.stories.mdx b/packages/hexon-web/src/components/HIcon.stories.mdx index 051f986b..db44e750 100644 --- a/packages/hexon-web/src/components/HIcon.stories.mdx +++ b/packages/hexon-web/src/components/HIcon.stories.mdx @@ -28,10 +28,10 @@ import HIcon from "./HIcon.vue"; template: ` -  + -  + @@ -51,10 +51,10 @@ import HIcon from "./HIcon.vue"; template: ` -  + -  + @@ -75,12 +75,12 @@ import HIcon from "./HIcon.vue"; -   + -   +