index.js 297 B

123456789101112131415161718192021222324
  1. // pages/commodity/index.js
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. checkedId: '1'
  8. },
  9. onLoad(options) {
  10. },
  11. onShow() {
  12. },
  13. checked({
  14. currentTarget
  15. }) {
  16. console.log(currentTarget);
  17. this.setData({
  18. checkedId: currentTarget.dataset.id
  19. })
  20. }
  21. })