C端小程序
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.

42 lines
982 B

  1. Component({
  2. externalClasses: ['i-class'],
  3. properties : {
  4. //slot name
  5. name : {
  6. type : String,
  7. value : ''
  8. },
  9. //can click or not click
  10. checkable : {
  11. type : Boolean,
  12. value : false
  13. },
  14. //is current choose
  15. checked : {
  16. type : Boolean,
  17. value : true
  18. },
  19. //background and color setting
  20. color : {
  21. type : String,
  22. value : 'default'
  23. },
  24. //control fill or not
  25. type : {
  26. type : String,
  27. value : 'dot'
  28. }
  29. },
  30. methods : {
  31. tapTag(){
  32. const data = this.data;
  33. if( data.checkable ){
  34. const checked = data.checked ? false : true;
  35. this.triggerEvent('change',{
  36. name : data.name || '',
  37. checked : checked
  38. });
  39. }
  40. }
  41. }
  42. })