navigation.vue 1.9 KB
Newer Older
L
ligang 已提交
1 2 3 4 5
<template>
  <div class="select-demo-wrapper">
    <section class="demo-section">
      <h4>键盘导航</h4>
      <div>
B
break60 已提交
6
        <x-select multiple filterable height="150" highlight-matched-text>
L
ligang 已提交
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
          <x-option
            v-for="city in cities"
            :key="city.value"
            :value="city"
            :label="city.label"
          >
          </x-option>
        </x-select>
      </div>
    </section>
  </div>
</template>

<script>
import { xSelect, xOption, xOptionGroup } from '../src'

export default {
  name: 'app',
  components: { xSelect, xOption, xOptionGroup },
  data () {
    return {
      cities: [{
        id: 1,
        value: 'Beijing',
B
break60 已提交
31
        label: '北京'
L
ligang 已提交
32 33 34
      }, {
        id: 2,
        value: 'Shanghai',
B
break60 已提交
35
        label: '上海'
L
ligang 已提交
36 37 38
      }, {
        id: 3,
        value: 'Nanjing',
B
break60 已提交
39
        label: '南京'
L
ligang 已提交
40 41 42
      }, {
        id: 4,
        value: 'Chengdu',
B
break60 已提交
43
        label: '成都'
L
ligang 已提交
44 45 46
      }, {
        id: 5,
        value: 'Shenzhen',
B
break60 已提交
47
        label: '深圳'
L
ligang 已提交
48 49 50
      }, {
        id: 6,
        value: 'Guangzhou',
B
break60 已提交
51
        label: '广州'
L
ligang 已提交
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 111
      }]
    }
  }
}
</script>

<style lang="scss">
.demo-wrapper {
  .cate {
    height: 40px;
    margin-left: 20px;
    font-size: 16px;
    font-weight: bold;
    line-height: 40px;
  }
  .row {
    display: flex;
    margin: 20px 0;
    padding: 0 50px;
    & > div {
      margin-right: 50px;
    }
  }
  .custom {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    &:hover {
      background: #8492a6;
      .left,
      .right {
        color: #fff;
      }
    }
    .left {
      font-size: 12px;
    }
    .right {
      color: #8492a6;
      font-size: 12px;
      transform: scale(0.8);
    }
  }
  .selected .custom {
    color: #598cd4;
    background: #dfd8e4;
  }
  .custom-group {
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    color: #303030;
    font-weight: bolder;
    background: #b7d1f0;
    i {
      margin: 0 10px;
    }
  }
}
</style>