index.js 575 B

12345678910111213141516171819202122232425262728293031
  1. Component({
  2. externalClasses: ["i-class"],
  3. properties: {
  4. name: {
  5. type: String,
  6. value: ""
  7. }
  8. },
  9. relations: {
  10. "../index/index": {
  11. type: "parent"
  12. }
  13. },
  14. data: {
  15. top: 0,
  16. height: 0,
  17. currentName: ""
  18. },
  19. methods: {
  20. updateDataChange: function () {
  21. var that = this;
  22. wx.createSelectorQuery().in(this).select(".i-index-item").boundingClientRect(function (t) {
  23. that.setData({
  24. top: t.top,
  25. height: t.height,
  26. currentName: that.data.name
  27. });
  28. }).exec();
  29. }
  30. }
  31. });