document.execCommand废弃;复制功能

 
 
navigator.clipboard.writeText(‘copy内容’).then(
        function () {

          /* clipboard successfully set */
        },
        function () {
          /* clipboard write failed */
        }
      );
 
posted @ 2022-06-07 14:59  DawnZhao  阅读(1183)  评论(0编辑  收藏  举报