You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
820 B

  1. <template lang="pug">
  2. .colorpicker
  3. .colorpicker-choice(v-for='color in colors', :class='["is-" + color, color === value ? "is-active" : ""]', @click='setColor(color)')
  4. </template>
  5. <script>
  6. export default {
  7. name: 'color-picker',
  8. props: ['value'],
  9. data () {
  10. return {
  11. colors: [
  12. 'red',
  13. 'pink',
  14. 'purple',
  15. 'deep-purple',
  16. 'indigo',
  17. 'blue',
  18. 'light-blue',
  19. 'cyan',
  20. 'teal',
  21. 'green',
  22. 'light-green',
  23. 'lime',
  24. 'yellow',
  25. 'amber',
  26. 'orange',
  27. 'deep-orange',
  28. 'brown',
  29. 'grey',
  30. 'blue-grey'
  31. ]
  32. }
  33. },
  34. methods: {
  35. setColor(color) {
  36. this.$emit('input', color)
  37. }
  38. }
  39. }
  40. </script>