demo.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="demo">
  3. <div class="title">按钮类型</div>
  4. <div class="demo-button-row">
  5. <nut-button type="primary">主要按钮</nut-button>
  6. <nut-button type="info">信息按钮</nut-button>
  7. <nut-button type="default">默认按钮</nut-button>
  8. </div>
  9. <div class="demo-button-row2">
  10. <nut-button type="danger">危险按钮</nut-button>
  11. <nut-button type="warning">警告按钮</nut-button>
  12. <nut-button type="success">成功按钮</nut-button>
  13. </div>
  14. <div class="title">边框按钮</div>
  15. <div class="title">禁用状态</div>
  16. <div class="title">按钮形状</div>
  17. <div class="title">加载状态</div>
  18. <div class="title">图标按钮</div>
  19. <div class="title">按钮尺寸</div>
  20. <nut-button block type="primary">通栏按钮</nut-button>
  21. <nut-button>普通按钮</nut-button>
  22. <nut-button>小型按钮</nut-button>
  23. </div>
  24. </template>
  25. <script lang="ts">
  26. import Button from '@/packages/button/index.vue';
  27. import { createDemoComponent } from '@/utils/create';
  28. export default createDemoComponent('button')({
  29. props: {
  30. text: String
  31. },
  32. components: { 'nut-button': Button },
  33. emits: ['click']
  34. });
  35. </script>
  36. <style lang="scss" scoped>
  37. .demo-button-row {
  38. margin-bottom: 20px;
  39. }
  40. .demo-button-row2 {
  41. margin-bottom: 10px;
  42. }
  43. .nut-button {
  44. margin-right: 15px;
  45. &:last-child {
  46. margin-bottom: 0;
  47. margin-right: 0;
  48. }
  49. }
  50. </style>