1234567891011121314151617181920212223242526272829 |
- ;
- layui.define(['form'], function (e) {
- var s = layui.$;
- var invite = function(){
- invite.prototype.loadclipboard(function(){
- var clipboard = new ClipboardJS('.layui-btn-copy');
- clipboard.on('success', function(e) {
- layer.msg('复制成功');
- e.clearSelection();
- });
- });
- }
- invite.prototype.loadclipboard = function(callback){
- var head = document.getElementsByTagName('head')[0];
- var script = document.createElement('script');
- script.type = 'text/javascript';
- script.src = '/static/plugins/clipboard/clipboard.min.js';
- script.onload = script.onreadystatechange = function () {
- if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete"){
- callback();
- script.onload = script.onreadystatechange = null;
- }
- };
- head.appendChild(script);
- }
- e('invite',new invite())
- })
|