Glant

1.复制功能可以参照官方文档,

 copytext: function() {
    var that = this;
    wx.setClipboardData({
      data: that.data.shareresult.content,
      success: function(res) {
        if (res.confirm) {
          console.log(\'确定\')
        } else if (res.cancel) {
          console.log(\'取消\')
        }
      }
    });
  },

 2.背景颜色渐变实现

-->wxml

<view class=\'copyBtn\' bindtap="copytext">复制文字</view>

-->wxss

 background: linear-gradient(to right, #3d6aea, #7318d9);/
.copyBtn {
  margin: 35rpx auto;
  width: 240rpx;
  height: 60rpx;
  text-align: center;
  line-height: 60rpx;
  border-radius: 30rpx;
  color: #fff;
  background: linear-gradient(to right, #3d6aea, #7318d9);//使用linear-gradient 指定方向(to right/to left) 以逗号分割 两侧不同的颜色
}

  

分类:

技术点:

相关文章:

  • 2021-12-16
  • 2022-01-12
  • 2021-10-14
  • 2021-06-26
  • 2021-04-02
  • 2021-10-14
  • 2021-12-20
猜你喜欢
  • 2021-09-11
  • 2022-12-23
  • 2021-12-04
  • 2021-05-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案