1.不带input输入框的原生js方法
这种情况适用于复制非输入框中的文本到剪切板
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
2.带输入框的原生js方法
用于复制input,textarea中的文本
1 2 3 4 5 6 7 8 9 10 11 |
|
3、Vue框架提供的剪切板插件 vue-clipboard2
1 2 3 4 5 |
|
Sample1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
Sample2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
|