vue-hot-reload-api
Advanced tools
Comparing version
38
index.js
@@ -98,2 +98,8 @@ var Vue // late bind | ||
var record = map[id] | ||
if (!options) { | ||
record.instances.slice().forEach(function (instance) { | ||
instance.$forceUpdate() | ||
}) | ||
return | ||
} | ||
if (typeof options === 'function') { | ||
@@ -113,19 +119,21 @@ options = options.options | ||
exports.reload = tryWrap(function (id, options) { | ||
if (typeof options === 'function') { | ||
options = options.options | ||
} | ||
makeOptionsHot(id, options) | ||
var record = map[id] | ||
if (version[1] < 2) { | ||
// preserve pre 2.2 behavior for global mixin handling | ||
record.Ctor.extendOptions = options | ||
if (options) { | ||
if (typeof options === 'function') { | ||
options = options.options | ||
} | ||
makeOptionsHot(id, options) | ||
if (version[1] < 2) { | ||
// preserve pre 2.2 behavior for global mixin handling | ||
record.Ctor.extendOptions = options | ||
} | ||
var newCtor = record.Ctor.super.extend(options) | ||
record.Ctor.options = newCtor.options | ||
record.Ctor.cid = newCtor.cid | ||
record.Ctor.prototype = newCtor.prototype | ||
if (newCtor.release) { | ||
// temporary global mixin strategy used in < 2.0.0-alpha.6 | ||
newCtor.release() | ||
} | ||
} | ||
var newCtor = record.Ctor.super.extend(options) | ||
record.Ctor.options = newCtor.options | ||
record.Ctor.cid = newCtor.cid | ||
record.Ctor.prototype = newCtor.prototype | ||
if (newCtor.release) { | ||
// temporary global mixin strategy used in < 2.0.0-alpha.6 | ||
newCtor.release() | ||
} | ||
record.instances.slice().forEach(function (instance) { | ||
@@ -132,0 +140,0 @@ if (instance.$vnode && instance.$vnode.context) { |
{ | ||
"name": "vue-hot-reload-api", | ||
"version": "2.0.11", | ||
"version": "2.1.0", | ||
"description": "hot reload api for *.vue components", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
9193
2.01%131
6.5%