App.vue 5.8 KB
Newer Older
M
init  
miaodian 已提交
1 2 3 4 5 6
<template>
  <div id="app">
    <header class="cube-bar">
      <h1>cube-ui</h1>
    </header>
    <section class="cube-content" ref="mfct">
T
tank0317 已提交
7 8 9 10 11 12 13 14 15 16 17 18
      <cube-index-list :data="components" class="cube-list">
        <cube-index-list-group v-for="(group, index) in components" :key="index" :group="group">
          <cube-index-list-item v-for="(component, index) in group.items" :key="index" :item="component">
            <div class="cube-item border-bottom-1px" >
              <router-link class="link" :to="component.path">{{component.text}}<i
                class="cubeic-arrow"></i>
              </router-link>
            </div>
          </cube-index-list-item>
        </cube-index-list-group>
        <span class="custom-nav-item" slot="nav-item" slot-scope="props">{{props.item}}</span>
      </cube-index-list>
M
init  
miaodian 已提交
19
    </section>
D
dolymood 已提交
20
    <cube-view></cube-view>
M
init  
miaodian 已提交
21 22 23 24
  </div>
</template>

<script type="text/ecmascript-6">
D
dolymood 已提交
25 26
  import CubeView from './components/cube-view.vue'

M
init  
miaodian 已提交
27 28 29 30 31
  export default {
    data() {
      return {
        components: [
          {
T
tank0317 已提交
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
            'name': 'Basic 基础组件',
            'shortcut': 'Basic',
            'items': [
              {
                path: '/button',
                text: 'Button'
              },
              {
                path: '/loading',
                text: 'Loading'
              },
              {
                path: '/tip',
                text: 'Tip'
              }
            ]
          },
          {
            'name': 'Form 表单组件',
            'shortcut': 'Form',
            'items': [
              {
                path: '/checkbox',
                text: 'Checkbox'
              },
              {
                path: '/checkbox-group',
                text: 'CheckboxGroup'
              },
              {
                path: '/radio',
                text: 'Radio'
              },
              {
                path: '/input',
                text: 'Input'
              },
              {
                path: '/textarea',
                text: 'Textarea'
              },
              {
                path: '/select',
                text: 'Select'
              },
              {
                path: '/switch',
                text: 'Switch'
              },
              {
                path: '/rate',
                text: 'Rate'
              },
              {
                path: '/validator',
                text: 'Validator'
              },
              {
                path: '/upload',
                text: 'Upload'
              },
              {
                path: '/form',
                text: 'Form'
              }
            ]
          },
          {
            'name': 'Popup 弹窗组件',
            'shortcut': 'Popup',
            'items': [
              {
                path: '/popup',
                text: 'Popup'
              },
              {
                path: '/toast',
                text: 'Toast'
              },
111

T
tank0317 已提交
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
              {
                path: '/picker',
                text: 'Picker'
              },
              {
                path: '/cascade-picker',
                text: 'CascadePicker'
              },
              {
                path: '/segment-picker',
                text: 'SegmentPicker'
              },
              {
                path: '/date-picker',
                text: 'DatePicker'
              },
              {
                path: '/time-picker',
                text: 'TimePicker'
              },
              {
                path: '/dialog',
                text: 'Dialog'
              },
              {
                path: '/action-sheet',
                text: 'ActionSheet'
              },
              {
                path: '/drawer',
                text: 'Drawer'
              }
            ]
          },
          {
            'name': 'Scroll 滚动组件',
            'shortcut': 'Scroll',
            'items': [
              {
                path: '/scroll',
                text: 'Scroll'
              },
              {
                path: '/slide',
                text: 'Slide'
              },
              {
                path: '/index-list',
                text: 'IndexList'
              },
              {
                path: '/swipe',
                text: 'Swipe'
              }
            ]
M
init  
miaodian 已提交
167 168 169 170
          }
        ]
      }
    },
D
dolymood 已提交
171 172
    components: {
      CubeView
M
init  
miaodian 已提交
173 174 175 176 177
    }
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
A
AmyFoxFN 已提交
178 179
  html, body, #app
    height: 100%
H
HuangYi 已提交
180

M
init  
miaodian 已提交
181 182
  body
    background-color: #fff
A
AmyFoxFN 已提交
183
    overflow: hidden
H
HuangYi 已提交
184

M
init  
miaodian 已提交
185 186
  .cube-bar
    z-index: 10
A
AmyFoxFN 已提交
187
    position: absolute
M
init  
miaodian 已提交
188 189 190 191 192
    right: 0
    left: 0
    height: 44px
    line-height: 44px
    text-align: center
L
liyirui_i 已提交
193 194
    background-color: #EDF0F4
    box-shadow: 0 2px 1px #e9eaea
M
init  
miaodian 已提交
195 196 197 198 199 200 201
    -webkit-backface-visibility: hidden
    backface-visibility: hidden
    h1
      font-size: 18px
      font-weight: 500

  .cube-content
A
AmyFoxFN 已提交
202
    position: absolute
M
init  
miaodian 已提交
203 204
    top: 44px
    left: 0
A
AmyFoxFN 已提交
205
    right: 0
M
init  
miaodian 已提交
206 207
    bottom: 0
    overflow: scroll
A
AmyFoxFN 已提交
208
    -webkit-overflow-scrolling: touch
M
init  
miaodian 已提交
209 210
    .cube-list
      padding-left: 10px
T
tank0317 已提交
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
      .cube-index-list-group
        .cube-index-list-anchor
          font-size: 16px
        ul
          .cube-item
            height: 40px
            line-height: 40px
            padding-left: 16px
            .link
              display: block
              position: relative
              width: 100%
              color: #333
              text-decoration: none
              outline: 0
              .cubeic-arrow
                position: absolute
                right: 0
                padding: 0 5px
                color: #ccc
      .cube-index-list-nav
          margin-right: 0px
          padding: 8px 5px
          border-radius: 3px 0 0 3px
          background: #f7f7f7
          box-shadow: 0 0 5px #80808047
          >ul
            >li
              padding: 8px 0
      .cube-index-list-fixed
        font-size: 16px
M
init  
miaodian 已提交
242
</style>