vue-hot-reload-api
Advanced tools
Comparing version
@@ -170,6 +170,12 @@ var Vue // late bind | ||
} | ||
// post 2.5.4: v-once trees are cached on instance._staticTrees. | ||
// Pure static trees are cached on the staticRenderFns array | ||
// (both already reset above) | ||
// 2.6: temporarily mark rendered scoped slots as unstable so that | ||
// child components can be forced to update | ||
var restore = patchScopedSlots(instance) | ||
instance.$forceUpdate() | ||
instance.$nextTick(restore) | ||
}) | ||
@@ -245,1 +251,15 @@ } else { | ||
}) | ||
// 2.6 optimizes template-compiled scoped slots and skips updates if child | ||
// only uses scoped slots. We need to patch the scoped slots resolving helper | ||
// to temporarily mark all scoped slots as unstable in order to force child | ||
// updates. | ||
function patchScopedSlots (instance) { | ||
if (!instance._u) { return } | ||
// https://github.com/vuejs/vue/blob/dev/src/core/instance/render-helpers/resolve-scoped-slots.js | ||
var original = instance._u | ||
instance._u = function (slots) { return original(slots, true); } | ||
return function () { | ||
instance._u = original | ||
} | ||
} |
{ | ||
"name": "vue-hot-reload-api", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "hot reload api for *.vue components", | ||
@@ -30,6 +30,6 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"buble": "^0.16.0", | ||
"jest": "^21.2.1", | ||
"vue": "^2.4.4" | ||
"buble": "^0.19.6", | ||
"jest": "^23.6.0", | ||
"vue": "^2.5.21" | ||
} | ||
} |
10839
7.66%242
7.56%