Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

手机端,无法使用,我所测试的有小米,iPhone10 #77

Open
songlin1994 opened this issue Nov 20, 2019 · 10 comments
Open

手机端,无法使用,我所测试的有小米,iPhone10 #77

songlin1994 opened this issue Nov 20, 2019 · 10 comments

Comments

@songlin1994
Copy link

使用的是官网例子Sample 2

@tal007
Copy link

tal007 commented Nov 29, 2019

一样

@yanhairui
Copy link

+1,华为,ios,都不行

@songlin1994
Copy link
Author

开发者也不看那....

@Inndy
Copy link
Owner

Inndy commented Dec 4, 2019

It works on my iPhone 8 (with iOS 13.1.3 and Safari).

Please notice that samples use Cloudflare CDN to load Vue.js and it might be blocked by GFW.

I can't help without error message from developer console.

@yanhairui
Copy link

开发者也不看那....
什么意思……

@tal007
Copy link

tal007 commented Dec 4, 2019

Maybe it dosen't match the new version of android or IOS. So i use https://clipboardjs.com/
it works on some platform but not all. But it's better than this plugin. And the if the plugin not work on platform. I tell the users to copy by himself.

也许与Android或IOS的新版本不匹配。所以我用 https://clipboardjs.com/
它可以在某些平台上运行,但不是全部。但这比这个插件更好。并且如果插件在平台上不起作用。我告诉用户自己复制。

@Cobatkao
Copy link

同样的状况 PC端复制正常 所有移动端都会直接进入错误分支 看来是通病了

@ddzy
Copy link

ddzy commented Dec 29, 2019

同样的状况 PC端复制正常 所有移动端都会直接进入错误分支 看来是通病了

同样的问题

我采用了这种方式, 来解决问题:

this.$copyText(pendingCopyValue).then((suc) => {
    console.log('复制成功!');
}, (err) => {
    if(err && typeof err === 'object' && err.hasOwnProperty('action') && err.hasOwnProperty('text')) {
        console.log('复制成功!');
    } else {
        console.log('复制失败, 请稍后重试!');
    }
});

@Wjy1005
Copy link

Wjy1005 commented Nov 4, 2020

同样的状况 PC端复制正常 所有移动端都会直接进入错误分支 看来是通病了

同样的问题

我采用了这种方式, 来解决问题:

this.$copyText(pendingCopyValue).then((suc) => {
    console.log('复制成功!');
}, (err) => {
    if(err && typeof err === 'object' && err.hasOwnProperty('action') && err.hasOwnProperty('text')) {
        console.log('复制成功!');
    } else {
        console.log('复制失败, 请稍后重试!');
    }
});

但是实际上是复制失败的,黏贴版上并没有文字

@duzhenyi
Copy link

duzhenyi commented May 18, 2021

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>vue-clipboard2 sample app</title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.6/vue.js"></script>
  <script src="../dist/vue-clipboard.js"></script>
</head>
<body>
  <div id="app"></div>

  <template id="t">
    <div class="container">
    <input type="text" v-model="message">
    <button type="button" @click="doCopy">Copy!</button>
    </div>
  </template>

  <script>
  new Vue({
    el: '#app',
    template: '#t',
    data: function () {
      return {
        message: 'Copy These Text'
      }
    },
    methods: {
      doCopy: function () {
		let that = this
	   // 请求后端接口,等待返回参数,再进行copy,会copy失败,例如:
	   that.api.get('api/getUserName').then(res=>{
	   
		that.$copyText(res.userName).then(function (e) {
          alert('Copied')
          console.log(e)
        }, function (e) {
          alert('Can not copy')
          console.log(e)
        })
		
	   })
      }
    }
  })
  </script>
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants