前端如何实现将文本复制到剪切板
dearweb 发布:2022-11-11 22:14:28阅读:前端实现将文本复制到剪切板功能演示
let copyValue = ` 产品标题:${state.orderDetail.contents}\n 产品参数:${state.orderDetail.code_id}\n 产品ID:${state.orderDetail.content_id}\n SKU名称:${state.orderDetail.product_desc}\n 订单ID:${state.orderDetail.order_id}\n 数量:${state.orderDetail.quantity}\n 总价:${state.orderDetail.amount}\n 收件人:${state.orderDetail.name}\n 国家:${state.orderDetail.country_code}\n 手机:${state.orderDetail.mobile}\n 备用手机:${state.orderDetail.spare_phone}\n 发货号码:${state.orderDetail.mobile}\n 省:${state.orderDetail.province}\n 市:${state.orderDetail.city}\n 区:${state.orderDetail.district}\n 地址:${state.orderDetail.address}\n 全部地址:${addressValue}\n `; navigator.clipboard.writeText(copyValue)
小礼物走一波,支持作者
赏还没有人赞赏,支持一波吧