Copy.js 577 B

123456789101112131415161718192021222324252627282930
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. m_LabText: cc.Label,
  5. },
  6. ctor: function() {
  7. },
  8. onLoad: function() {
  9. if(!this.m_LabText) this.m_LabText = this.$('@Label');
  10. },
  11. start: function () {
  12. },
  13. OnClicked_Copy: function() {
  14. if(!this.m_LabText) {
  15. if(window.LOG_DEBUG) console.log(' 没有绑定复制节点! ');
  16. return;
  17. }
  18. ThirdPartyCopyClipper(this.m_LabText.string);
  19. g_CurScene.ShowTips(`已複製到剪貼簿`);
  20. },
  21. });