当前位置:   article > 正文

HarmonyOS应用开发-list列表圆角的实现_harmonyos radius csdn

harmonyos radius csdn

以下为JS代码、xml和CSS代码,具体如下所示:

JS代码:

  1. import prompt from '@system.prompt';
  2. var timeoutID;
  3. const DURATION = 600;
  4. export default {
  5. data: {
  6. topList: [{
  7. title: 'title3_1',
  8. desc: 'description3_1',
  9. cls: 'todo_item_top',
  10. iconColor: '#99FF0000',
  11. txtColor: 'white',
  12. indexTxt: 'R'
  13. }, {
  14. title: 'title3_2',
  15. desc: 'description3_2',
  16. cls: 'todo_item_mid',
  17. iconColor: '#99FF7D00',
  18. txtColor: 'white',
  19. indexTxt: 'T'
  20. }, {
  21. title: 'title3_3',
  22. desc: 'description3_3',
  23. cls: 'todo_item_bottom',
  24. iconColor: '#99FF00FF',
  25. txtColor: 'white',
  26. indexTxt: 'Y'
  27. }
  28. ],
  29. middleList: [{
  30. title: 'title2_1',
  31. desc: 'description2_1',
  32. cls: 'todo_item_top',
  33. iconColor: '#9900FF00',
  34. txtColor: 'white',
  35. indexTxt: 'U'
  36. }, {
  37. title: 'title2_2',
  38. desc: 'description2_2',
  39. cls: 'todo_item_bottom',
  40. iconColor: '#9900FFFF',
  41. txtColor: 'white',
  42. indexTxt: 'I'
  43. }
  44. ],
  45. bottomList: [{
  46. title: 'title1_1',
  47. desc: 'description1_1',
  48. cls: 'todo_item_round',
  49. iconColor: '#990000FF',
  50. txtColor: 'white',
  51. indexTxt: 'O'
  52. }
  53. ]
  54. },
  55. onTopListItemClick($idx) {
  56. console.info("id = " + $idx);
  57. let index = $idx;
  58. let size = this.topList.length;
  59. if (index == -1) {
  60. for (let i = 0; i < size; i++) {
  61. if (i == 0) {
  62. this.topList[i].cls = "todo_item_top"
  63. } else if (i == size - 1) {
  64. this.topList[i].cls = "todo_item_bottom"
  65. } else {
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/281109
推荐阅读
相关标签
  

闽ICP备14008679号