index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import zIndex from '../behaviors/zIndex';
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. behaviors: [zIndex],
  7. externalClasses: ['l-class','l-mask-class'],
  8. properties: {
  9. // 显示与隐藏
  10. show: {
  11. type: Boolean,
  12. value: false
  13. },
  14. // 不透明度
  15. opacity: {
  16. type: [String, Number],
  17. value: .4
  18. },
  19. // mask的z-index值
  20. zIndex: {
  21. type: Number,
  22. value: 99,
  23. },
  24. // slot是否居中
  25. center: {
  26. type: Boolean,
  27. value: false,
  28. },
  29. // 锁定
  30. locked: {
  31. type: Boolean,
  32. value: true
  33. },
  34. // 全屏幕模式 暂不可用
  35. fullScreen: {
  36. type: String,
  37. value: ''
  38. },
  39. // 导航栏颜色
  40. NavColor: {
  41. type: String,
  42. value: ''
  43. },
  44. },
  45. /**
  46. * 组件的初始数据
  47. */
  48. data: {
  49. },
  50. /**
  51. * 组件的方法列表
  52. */
  53. methods: {
  54. // 阻止滑动
  55. doNothingMove() {
  56. // do nothing……
  57. },
  58. // 点击事件
  59. onMaskTap() {
  60. let detail = true;
  61. let option = { bubbles: true, composed: true };
  62. if (this.data.locked !== true) {
  63. this.setData({
  64. // fullScreen: 'hide',
  65. show: false,
  66. });
  67. }
  68. this.triggerEvent('lintap', detail, option);
  69. }
  70. },
  71. attached: function () {
  72. },
  73. });