fab.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  2. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  3. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  4. else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  5. return c > 3 && r && Object.defineProperty(target, key, r), r;
  6. };
  7. import { SuperComponent, wxComponent } from '../common/src/index';
  8. import config from '../common/config';
  9. import props from './props';
  10. const { prefix } = config;
  11. const name = `${prefix}-fab`;
  12. let Fab = class Fab extends SuperComponent {
  13. constructor() {
  14. super(...arguments);
  15. this.properties = props;
  16. this.externalClasses = [`${prefix}-class`, `${prefix}-class-button`];
  17. this.data = {
  18. prefix,
  19. classPrefix: name,
  20. baseButtonProps: {
  21. size: 'large',
  22. shape: 'circle',
  23. theme: 'primary',
  24. },
  25. };
  26. this.observers = {
  27. text(val) {
  28. if (val) {
  29. this.setData({
  30. baseButtonProps: {
  31. shape: 'round',
  32. },
  33. });
  34. }
  35. },
  36. };
  37. this.methods = {
  38. onTplButtonTap(e) {
  39. this.triggerEvent('click', e);
  40. },
  41. };
  42. }
  43. };
  44. Fab = __decorate([
  45. wxComponent()
  46. ], Fab);
  47. export default Fab;