Browse Source

feat: 按钮更新

zy19940510 5 years ago
parent
commit
8a0db8cf96
3 changed files with 100 additions and 72 deletions
  1. 15 5
      src/packages/button/demo.vue
  2. 84 66
      src/packages/button/doc.md
  3. 1 1
      src/packages/button/index.vue

+ 15 - 5
src/packages/button/demo.vue

@@ -34,12 +34,22 @@
     <h2>按钮尺寸</h2>
     <div class="demo-button-row2">
       <div class="demo-button-row2">
-        <nut-button block type="primary">通栏按钮</nut-button>
-      </div>
-      <div class="demo-button-row2">
-        <nut-button type="primary">普通按钮</nut-button>
-        <nut-button size="small" type="primary">小型按钮</nut-button>
+        <nut-button size="large" type="primary">大号按钮</nut-button>
       </div>
+      <nut-button type="primary">普通按钮</nut-button>
+      <nut-button size="small" type="primary">小型按钮</nut-button>
+    </div>
+    <h2>块级元素</h2>
+    <div class="demo-button-row2">
+      <nut-button block type="primary">块级元素</nut-button>
+    </div>
+    <h2>自定义颜色</h2>
+    <div class="demo-button-row2">
+      <nut-button color="#7232dd">单色按钮</nut-button>
+      <nut-button color="#7232dd" plain>单色按钮</nut-button>
+      <nut-button color="linear-gradient(to right, #ff6034, #ee0a24)">
+        渐变按钮
+      </nut-button>
     </div>
   </div>
 </template>

File diff suppressed because it is too large
+ 84 - 66
src/packages/button/doc.md


+ 1 - 1
src/packages/button/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view :class="classes" @click="handleClick">
+  <view :class="classes" :style="getStyle" @click="handleClick">
     <!-- <i class="nut-icon-loading" v-if="loading"></i> -->
     <!-- <i :class="icon" v-if="icon && !loading"></i> -->
     <slot></slot>