note/note.vue

  1. <template>
  2. <div class="ion-note" :class="[modeClass,colorClass]">
  3. <slot></slot>
  4. </div>
  5. </template>
  6. <style lang="scss" src="./style.scss"></style>
  7. <script type="text/javascript">
  8. /**
  9. * @component Note
  10. * @description
  11. *
  12. * ## 其他 / note组件
  13. *
  14. * 文字颜色变暗10%的组件, 除此之外别无其他.
  15. *
  16. * @props {String} color - 颜色
  17. * @props {String} [mode='ios'] - 模式
  18. *
  19. * */
  20. export default {
  21. name: 'Note',
  22. props: {
  23. /**
  24. * 按钮color:primary、secondary、danger、light、dark
  25. * */
  26. color: [String],
  27. /**
  28. * mode 按钮风格
  29. * */
  30. mode: {
  31. type: String,
  32. default () { return this.$config && this.$config.get('mode') || 'ios' }
  33. }
  34. },
  35. computed: {
  36. // 环境样式
  37. modeClass () {
  38. return `note note-${this.mode}`
  39. },
  40. // 颜色
  41. colorClass () {
  42. return this.color ? (`note-${this.mode}-${this.color}`) : ''
  43. }
  44. }
  45. }
  46. </script>