Blame view

src/components/color-picker/recommend-colors.vue 536 Bytes
9af2f01c   梁灏   update ColorPicker
1
2
3
  <template>
      <div>
          <template v-for="(item, index) in list">
1f61a559   梁灏   update ColorPicker
4
              <span @click="handleClick(index)"><em :style="{'background': item}"></em></span>
9af2f01c   梁灏   update ColorPicker
5
6
7
8
9
10
11
12
13
              <br v-if="(index + 1) % 10 === 0 && index !== 0 && (index + 1) !== list.length">
          </template>
      </div>
  </template>
  <script>
      export default {
          props: {
              list: Array
          },
9af2f01c   梁灏   update ColorPicker
14
          methods: {
1f61a559   梁灏   update ColorPicker
15
16
17
              handleClick (index) {
                  this.$emit('picker-color', this.list[index]);
              }
9af2f01c   梁灏   update ColorPicker
18
19
20
          }
      };
  </script>