App.vue 6.5 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
            'name': 'Basic 基础组件',
            'shortcut': 'Basic',
            'items': [
              {
                path: '/button',
                text: 'Button'
              },
              {
                path: '/loading',
                text: 'Loading'
              },
              {
                path: '/tip',
                text: 'Tip'
A
Amy 已提交
46 47 48 49
              },
              {
                path: '/toolbar',
                text: 'Toolbar'
J
JiZhi 已提交
50 51 52 53
              },
              {
                path: '/tab-bar',
                text: 'TabBar'
T
tank0317 已提交
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
              }
            ]
          },
          {
            'name': 'Form 表单组件',
            'shortcut': 'Form',
            'items': [
              {
                path: '/checkbox',
                text: 'Checkbox'
              },
              {
                path: '/checkbox-group',
                text: 'CheckboxGroup'
              },
C
christlala 已提交
69 70 71 72
              {
                path: '/checker',
                text: 'Checker'
              },
T
tank0317 已提交
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 111 112 113 114 115 116 117 118 119 120 121 122
              {
                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'
              },
123

T
tank0317 已提交
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
              {
                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'
D
doly mood 已提交
155 156 157 158
              },
              {
                path: '/image-preview',
                text: 'ImagePreview'
T
tank0317 已提交
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
              }
            ]
          },
          {
            'name': 'Scroll 滚动组件',
            'shortcut': 'Scroll',
            'items': [
              {
                path: '/scroll',
                text: 'Scroll'
              },
              {
                path: '/slide',
                text: 'Slide'
              },
              {
                path: '/index-list',
                text: 'IndexList'
              },
              {
                path: '/swipe',
                text: 'Swipe'
181 182 183 184 185 186 187 188 189 190 191 192
              },
              {
                path: '/sticky',
                text: 'Sticky'
              },
              {
                path: '/scroll-nav-bar',
                text: 'ScrollNavBar'
              },
              {
                path: '/scroll-nav',
                text: 'ScrollNav'
T
tank0317 已提交
193 194
              }
            ]
M
init  
miaodian 已提交
195 196 197 198
          }
        ]
      }
    },
D
dolymood 已提交
199 200
    components: {
      CubeView
M
init  
miaodian 已提交
201 202 203 204 205
    }
  }
</script>

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

M
init  
miaodian 已提交
209 210
  body
    background-color: #fff
A
AmyFoxFN 已提交
211
    overflow: hidden
H
HuangYi 已提交
212

M
init  
miaodian 已提交
213 214
  .cube-bar
    z-index: 10
A
AmyFoxFN 已提交
215
    position: absolute
M
init  
miaodian 已提交
216 217 218 219 220
    right: 0
    left: 0
    height: 44px
    line-height: 44px
    text-align: center
L
liyirui_i 已提交
221 222
    background-color: #EDF0F4
    box-shadow: 0 2px 1px #e9eaea
M
init  
miaodian 已提交
223 224 225 226 227 228 229
    -webkit-backface-visibility: hidden
    backface-visibility: hidden
    h1
      font-size: 18px
      font-weight: 500

  .cube-content
A
AmyFoxFN 已提交
230
    position: absolute
M
init  
miaodian 已提交
231 232
    top: 44px
    left: 0
A
AmyFoxFN 已提交
233
    right: 0
M
init  
miaodian 已提交
234 235
    bottom: 0
    overflow: scroll
A
AmyFoxFN 已提交
236
    -webkit-overflow-scrolling: touch
M
init  
miaodian 已提交
237 238
    .cube-list
      padding-left: 10px
D
dolymood 已提交
239
      z-index: 1
T
tank0317 已提交
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
      .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 已提交
271
</style>