documentItem.ts 802 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // component/documentItem/documentItem.ts
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. itemData: null
  8. },
  9. /**
  10. * 组件的初始数据
  11. */
  12. data: {
  13. type: 1,
  14. hasDownLoad: true
  15. },
  16. lifetimes: {
  17. attached: function () {
  18. // 在组件实例被从页面节点树添加时执行
  19. this.setData({
  20. type: this.properties.itemData.type
  21. })
  22. },
  23. detached: function () {
  24. // 在组件实例被从页面节点树移除时执行
  25. },
  26. },
  27. /**
  28. * 组件的方法列表
  29. */
  30. methods: {
  31. showActionWindow: function () {
  32. this.triggerEvent("showActionWindow", { item: this.properties.itemData })
  33. }
  34. }
  35. })