index.js 698 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // components/My_Search/index.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. checked: {
  8. type: String,
  9. value: '全部'
  10. },
  11. showPop: {
  12. type: Function
  13. },
  14. searchContent: {
  15. type: Function
  16. }
  17. },
  18. /**
  19. * 组件的初始数据
  20. */
  21. data: {
  22. },
  23. /**
  24. * 组件的方法列表
  25. */
  26. methods: {
  27. /* 选择分类 */
  28. selected() {
  29. this.triggerEvent("showPop")
  30. },
  31. /* 搜索 */
  32. onSearch({
  33. detail
  34. }) {
  35. this.triggerEvent('searchContent', detail.trim());
  36. }
  37. }
  38. })