link.js 747 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.link = void 0;
  4. exports.link = Behavior({
  5. properties: {
  6. url: String,
  7. linkType: {
  8. type: String,
  9. value: 'navigateTo',
  10. },
  11. },
  12. methods: {
  13. jumpLink: function (urlKey) {
  14. if (urlKey === void 0) { urlKey = 'url'; }
  15. var url = this.data[urlKey];
  16. if (url) {
  17. if (this.data.linkType === 'navigateTo' &&
  18. getCurrentPages().length > 9) {
  19. wx.redirectTo({ url: url });
  20. }
  21. else {
  22. wx[this.data.linkType]({ url: url });
  23. }
  24. }
  25. },
  26. },
  27. });