temp-send-panel.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. var TempSendPanel = {
  2. template: '<div>\
  3. <div style="height: 34px;" >\
  4. 指导模板\
  5. <div class="save-btn">\
  6. 保存\
  7. </div>\
  8. </div>\
  9. <div class="temp-info c-f14">\
  10. <div class="temp-name pl10 ptb10">\
  11. 模板名称:<input placeholder="请输入模板名称( 10字内 )" class="c-f14" />\
  12. </div>\
  13. <div class="c-position-r">\
  14. <textarea @input="countWord" v-model="content" class="ptb10 plr10" style="border: 0;width: 100%;box-sizing: border-box;height: 180px;"></textarea>\
  15. <div class="c-t-right mr10 mb5 c-909090">{{count}}/{{words}}</div>\
  16. </div>\
  17. </div>\
  18. <div class="img-wrap mt20 c-f14">\
  19. <div>插入图片<span class="c-909090">(0/9)</span></div>\
  20. <div class="img-items mt10">\
  21. <img src="" />\
  22. </div>\
  23. </div>\
  24. <a class="send-btn c-t-center">\
  25. 发送\
  26. </a>\
  27. </div>',
  28. props: [],
  29. data: function() {
  30. return {
  31. words: 1000,
  32. count: 0,
  33. content: ""
  34. }
  35. },
  36. methods: {
  37. countWord: function() {
  38. if(this.content.length <= this.words) {
  39. this.count = this.content.length
  40. } else {
  41. this.content = this.content.slice(0, this.words)
  42. }
  43. }
  44. }
  45. }