Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. import Vue from 'vue'
  2. import autosize from 'autosize'
  3.  
  4. Vue.directive('autosize', {
  5. bind: function() {
  6. console.log('autosize bind')
  7. var self = this
  8. Vue.nextTick(function() {
  9. autosize(self.el)
  10. })
  11. },
  12.  
  13. update: function(value) {
  14. console.log('autosize update')
  15. var self = this
  16. Vue.nextTick(function() {
  17. self.el.value = value
  18. autosize.update(self.el)
  19. })
  20. },
  21.  
  22. unbind: function() {
  23. autosize.destroy(this.el)
  24. }
  25. })
  26.  
  27. import Autosize from 'components/directives/autosize.js'
  28.  
  29. directives: {
  30. Autosize
  31. }
  32.  
  33. console.log('autosize bind')
  34.  
  35. console.log('autosize update')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement