index.js 262 B

123456789101112131415161718
  1. Component({
  2. properties: {
  3. list: {
  4. type: Array
  5. },
  6. onClick: {
  7. type: Function
  8. }
  9. },
  10. methods: {
  11. handleClick(e) {
  12. const {
  13. item
  14. } = e.currentTarget.dataset;
  15. this.triggerEvent("onClick", item)
  16. },
  17. }
  18. })