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>
59dc2df0   梁灏   update ColorPicker
5
              <br v-if="(index + 1) % 12 === 0 && index !== 0 && (index + 1) !== list.length">
9af2f01c   梁灏   update ColorPicker
6
7
8
9
10
11
12
13
          </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>