ActivityIndicator 活动指示器

Scan me!

活动指示器,一般用于正在进行中的任务示意 1.4.0+

引入

  1. import { ActivityIndicator } from 'mand-mobile'
  2. Vue.component(ActivityIndicator.name, ActivityIndicator)

代码演示

Roller

  1. <template>
  2. <div class="md-example-child md-example-child-md-activity-indicator md-example-child-md-activity-indicator-0">
  3. <md-activity-indicator
  4. :size="20"
  5. :text-size="16"
  6. >加载中...</md-activity-indicator>
  7. <md-activity-indicator
  8. :size="20"
  9. :text-size="16"
  10. vertical
  11. >vertical loading</md-activity-indicator>
  12. <md-activity-indicator
  13. class="md-activity-indicator-css"
  14. color="#048efa"
  15. >loading...</md-activity-indicator>
  16. </div>
  17. </template>
  18. <script>
  19. import {ActivityIndicator} from 'mand-mobile'
  20. export default {
  21. name: 'activity-indicator-demo',
  22. title: 'Roller',
  23. components: {
  24. [ActivityIndicator.name]: ActivityIndicator,
  25. },
  26. }
  27. </script>
  28. <style lang="stylus">
  29. .md-example-child-md-activity-indicator-0
  30. display flex
  31. flex-direction column
  32. align-items center
  33. .md-activity-indicator
  34. margin-bottom 30px
  35. &.md-activity-indicator-css
  36. .md-activity-indicator-svg
  37. width 40px !important
  38. height 40px !important
  39. .md-activity-indicator-text
  40. font-size 32px
  41. </style>
  1. <template>
  2. <div class="md-example-child md-example-child-md-activity-indicator md-example-child-md-activity-indicator-2">
  3. <md-activity-indicator
  4. type="carousel"
  5. :size="15"
  6. ></md-activity-indicator>
  7. <md-button>
  8. <md-activity-indicator
  9. class="md-activity-indicator-css"
  10. type="carousel"
  11. :size="15"
  12. color="#fff"
  13. text-color="#fff"
  14. >正在支付</md-activity-indicator>
  15. </md-button>
  16. </div>
  17. </template>
  18. <script>
  19. import {ActivityIndicator, Button} from 'mand-mobile'
  20. export default {
  21. name: 'activity-indicator-demo',
  22. title: 'Carousel',
  23. components: {
  24. [ActivityIndicator.name]: ActivityIndicator,
  25. [Button.name]: Button,
  26. },
  27. }
  28. </script>
  29. <style lang="stylus">
  30. .md-example-child-md-activity-indicator-2
  31. display flex
  32. flex-direction column
  33. align-items center
  34. .md-activity-indicator
  35. margin-bottom 30px
  36. .md-button
  37. .md-activity-indicator-css
  38. margin-bottom 0
  39. .md-activity-indicator-svg
  40. height 15px !important
  41. </style>

Spinner

  1. <template>
  2. <div class="md-example-child md-example-child-md-activity-indicator md-example-child-md-activity-indicator-1">
  3. <md-activity-indicator
  4. type="spinner"
  5. :size="30"
  6. :text-size="20"
  7. >加载中...</md-activity-indicator>
  8. <div class="activity-indicator-container">
  9. <md-activity-indicator
  10. class="md-activity-indicator-css"
  11. type="spinner"
  12. :size="30"
  13. :text-size="20"
  14. color="light"
  15. >加载中...</md-activity-indicator>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import {ActivityIndicator} from 'mand-mobile'
  21. export default {
  22. name: 'activity-indicator-demo',
  23. title: 'Spinner',
  24. components: {
  25. [ActivityIndicator.name]: ActivityIndicator,
  26. },
  27. }
  28. </script>
  29. <style lang="stylus">
  30. .md-example-child-md-activity-indicator-1
  31. display flex
  32. flex-direction column
  33. align-items center
  34. .md-activity-indicator
  35. margin-bottom 30px
  36. .activity-indicator-container
  37. margin-bottom 30px
  38. padding 15px 20px
  39. background rgba(0, 0, 0, .7)
  40. border-radius 4px
  41. .md-activity-indicator-css
  42. margin-bottom 0
  43. .md-activity-indicator-svg
  44. width 40px !important
  45. height 40px !important
  46. .md-activity-indicator-text
  47. font-size 28px !important
  48. </style>

API

ActivityIndicator Props

属性说明类型默认值备注
type类型Stringrollerroller, spinner, carousel
size图标大小Number70px单位px, 也可直接重置.md-activity-indicator-svg样式
color图标颜色String#fc9153/darkspinner无法自定义色值,可选值只有darklight
text-color文字颜色String#999也可直接重置.md-activity-indicator-text样式
text-size文字大小String70px也可直接重置.md-activity-indicator-text样式
vertical图标文字是否垂直排列Booleanfalse-