vue-hot-reload-api
Advanced tools
Comparing version
15
index.js
@@ -107,10 +107,9 @@ var Vue // late bind | ||
exports.createRecord = function (id, options) { | ||
var Component = typeof options === 'function' | ||
? options | ||
: Vue.extend(options) | ||
options = Component.options | ||
if (typeof options === 'function') { | ||
options = options.options | ||
} | ||
if (typeof options.el !== 'string' && typeof options.data !== 'object') { | ||
makeOptionsHot(id, options) | ||
map[id] = { | ||
Component: Component, | ||
Component: null, | ||
views: [], | ||
@@ -132,3 +131,7 @@ instances: [] | ||
injectHook(options, 'created', function () { | ||
map[id].instances.push(this) | ||
var record = map[id] | ||
if (!record.Component) { | ||
record.Component = this.constructor | ||
} | ||
record.instances.push(this) | ||
}) | ||
@@ -135,0 +138,0 @@ injectHook(options, 'beforeDestroy', function () { |
{ | ||
"name": "vue-hot-reload-api", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "hot reload api for *.vue components", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
6187
0.83%217
1.4%