Explorar el Código

add vm.$nextTick

Evan You hace 11 años
padre
commit
7d882a9e71
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. 12 0
      src/api/dom.js

+ 12 - 0
src/api/dom.js

@@ -1,6 +1,18 @@
 var _ = require('../util')
 var transition = require('../transition')
 
+/**
+ * Convenience on-instance nextTick. The callback is
+ * auto-bound to the instance, and this avoids component
+ * modules having to rely on the global Vue.
+ *
+ * @param {Function} fn
+ */
+
+exports.$nextTick = function (fn) {
+  _.nextTick(fn, this)
+}
+
 /**
  * Append instance to target
  *