u-link.js 1.5 KB

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