u-link.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. "use strict";
  2. const common_vendor = require("../../../../common/vendor.js");
  3. const _sfc_main = {
  4. name: "u-link",
  5. mixins: [common_vendor.mpMixin, common_vendor.mixin, common_vendor.props$23],
  6. computed: {
  7. linkStyle() {
  8. const style = {
  9. color: this.color,
  10. fontSize: common_vendor.addUnit(this.fontSize),
  11. // line-height设置为比字体大小多2px
  12. lineHeight: common_vendor.addUnit(common_vendor.getPx(this.fontSize) + 2),
  13. textDecoration: this.underLine ? "underline" : "none"
  14. };
  15. return style;
  16. }
  17. },
  18. emits: ["click"],
  19. methods: {
  20. addStyle: common_vendor.addStyle,
  21. openLink() {
  22. common_vendor.index.setClipboardData({
  23. data: this.href,
  24. success: () => {
  25. common_vendor.index.hideToast();
  26. this.$nextTick(() => {
  27. common_vendor.toast(this.mpTips);
  28. });
  29. }
  30. });
  31. this.$emit("click");
  32. }
  33. }
  34. };
  35. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  36. return {
  37. a: common_vendor.t(_ctx.text),
  38. b: common_vendor.o((...args) => $options.openLink && $options.openLink(...args)),
  39. c: common_vendor.s($options.linkStyle),
  40. d: common_vendor.s($options.addStyle(_ctx.customStyle))
  41. };
  42. }
  43. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-dedad317"], ["__file", "D:/project/学吧/learn_applet/node_modules/uview-plus/components/u-link/u-link.vue"]]);
  44. wx.createComponent(Component);