ant-design-vue/components/button/demo/size.md
tangjinzhou 2349348de0 Merge branch 'master' into feat-1.4.0
# Conflicts:
#	components/button/__tests__/__snapshots__/demo.test.js.snap
#	components/button/buttonTypes.js
#	components/button/demo/basic.md
#	components/button/style/index.less
#	components/button/style/mixin.less
#	components/form/__tests__/__snapshots__/demo.test.js.snap
#	components/input/__tests__/__snapshots__/demo.test.js.snap
#	components/select/__tests__/__snapshots__/demo.test.js.snap
#	components/select/__tests__/__snapshots__/index.test.js.snap
#	components/tabs/__tests__/__snapshots__/demo.test.js.snap
#	components/vc-collapse/src/Collapse.jsx
#	package.json
2019-08-25 22:09:55 +08:00

1.7 KiB

#### 按钮尺寸 按钮有大、中、小三种尺寸。 通过设置 `size` 为 `large` `small` 分别把按钮设为大、小尺寸。若不设置 `size`,则尺寸为中。 #### Size Ant Design supports a default button size as well as a large and small size. If a large or small button is desired, set the `size` property to either `large` or `small` respectively. Omit the `size` property for a button with the default size.
<template>
  <div>
    <a-radio-group :value="size" @change="handleSizeChange">
      <a-radio-button value="large">Large</a-radio-button>
      <a-radio-button value="default">Default</a-radio-button>
      <a-radio-button value="small">Small</a-radio-button>
    </a-radio-group>
    <br /><br />
    <a-button type="primary" :size="size">Primary</a-button>
    <a-button :size="size">Normal</a-button>
    <a-button type="dashed" :size="size">Dashed</a-button>
    <a-button type="danger" :size="size">Danger</a-button>
    <a-button type="link" :size="size">Link</a-button>
    <br />
    <a-button type="primary" shape="circle" icon="download" :size="size" />
    <a-button type="primary" shape="round" icon="download" :size="size">Download</a-button>
    <a-button type="primary" icon="download" :size="size">Download</a-button>
    <br />
    <a-button-group :size="size">
      <a-button type="primary">
        <a-icon type="left" />Backward
      </a-button>
      <a-button type="primary">
        Forward<a-icon type="right" />
      </a-button>
    </a-button-group>
  </div>
</template>
<script>
export default {
  data () {
    return {
      size: 'large',
    }
  },
  methods: {
    handleSizeChange (e) {
      this.size = e.target.value
    },
  },
}
</script>