cube-page.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <div class="cube-page" :class="type">
  3. <header class="header">
  4. <h1>{{title}}</h1>
  5. <i @click="back" class="cubeic-back"></i>
  6. </header>
  7. <div class="wrapper">
  8. <section v-show="desc" class="desc"><slot name="desc">{{desc}}</slot></section>
  9. <main class="content">
  10. <slot name="content">{{content}}</slot>
  11. </main>
  12. </div>
  13. </div>
  14. </template>
  15. <script type="text/ecmascript-6">
  16. export default {
  17. props: {
  18. title: {
  19. type: String,
  20. default: '',
  21. required: true
  22. },
  23. type: {
  24. type: String,
  25. default: ''
  26. },
  27. desc: {
  28. type: String,
  29. default: ''
  30. },
  31. content: {
  32. type: String,
  33. default: ''
  34. }
  35. },
  36. methods: {
  37. back() {
  38. this.$router.back()
  39. }
  40. }
  41. }
  42. </script>
  43. <style lang="stylus" rel="stylesheet/stylus">
  44. @import "~@/common/stylus/variable.styl"
  45. .cube-page
  46. position: absolute
  47. z-index: 10
  48. top: 0
  49. left: 0
  50. width: 100%
  51. height: 100%
  52. background: #efeff4
  53. .header
  54. position: relative
  55. height: 44px
  56. line-height: 44px
  57. text-align: center
  58. background-color: #edf0f4
  59. box-shadow: 0 1px 6px #ccc
  60. -webkit-backface-visibility: hidden
  61. backface-visibility: hidden
  62. z-index: 5
  63. h1
  64. font-size: 16px
  65. font-weight: 700
  66. .cubeic-back
  67. position: absolute
  68. top: 0
  69. left: 0
  70. padding: 0 15px
  71. color: #fc9153
  72. >.wrapper
  73. height: calc(100% - 44px)
  74. overflow-x: hidden
  75. overflow-y: auto
  76. // -webkit-overflow-scrolling: touch
  77. .desc
  78. padding: 10px
  79. margin: 10px 0
  80. line-height: 20px
  81. font-size: 14px
  82. .content
  83. margin: 10px
  84. &.option-demo
  85. .wrapper
  86. background-color: $color-white
  87. .title
  88. font-size: $fontsize-large
  89. font-weight: 500
  90. color: $color-dark-grey
  91. padding: 15px
  92. border-bottom: 1px solid rgba(0, 0, 0, .1)
  93. margin-bottom: 15px
  94. .options
  95. margin-bottom: 15px
  96. .option-list
  97. .group
  98. margin-bottom: 15px
  99. border: 1px solid rgba(0, 0, 0, .1)
  100. border-radius: $radius-size-medium
  101. .item
  102. height: 52px
  103. border-bottom: 1px solid rgba(0, 0, 0, .1)
  104. &.sub
  105. font-size: $fontsize-medium
  106. background-color: $color-light-grey-opacity
  107. &.first
  108. box-shadow: 0 1px 1px 1px #eee inset
  109. &.last
  110. border-bottom: none
  111. .demo
  112. margin-bottom: 15px
  113. .methods
  114. .method-list
  115. .group
  116. margin-bottom: 15px
  117. border: 1px solid rgba(0, 0, 0, .1)
  118. border-radius: $radius-size-medium
  119. .item
  120. button
  121. height: 40px
  122. font-size: $fontsize-large
  123. .item
  124. background-color: $color-active-light-gray
  125. border-bottom: 1px solid rgba(0, 0, 0, .1)
  126. button
  127. width: 100%
  128. border-bottom-left-radius: $radius-size-medium
  129. border-bottom-right-radius: $radius-size-medium
  130. background-color: $color-orange
  131. box-shadow: 0 0 0 1px $color-orange
  132. border: none
  133. outline: none
  134. color: $color-white
  135. </style>