Skip to content

Commit

Permalink
fix undefined default slot when rendering complex components
Browse files Browse the repository at this point in the history
  • Loading branch information
tzolkincz committed Feb 9, 2020
1 parent 8a1e75d commit 854e0b5
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 27 deletions.
16 changes: 10 additions & 6 deletions dist/vue-tribute.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@ var VueTribute = {
handler: function handler() {
var _this = this;

var $el = this.$slots.default[0].elm;

if (this.tribute) {
this.tribute.detach($el);
setTimeout(function () {
_this.tribute = new Tribute(_this.options);
var $el = _this.$slots.default[0].elm;

_this.tribute.detach($el);

setTimeout(function () {
var $el = _this.$slots.default[0].elm;
_this.tribute = new Tribute(_this.options);

_this.tribute.attach($el);
_this.tribute.attach($el);

$el.tributeInstance = _this.tribute;
$el.tributeInstance = _this.tribute;
}, 0);
}, 0);
}
}
Expand Down
16 changes: 10 additions & 6 deletions dist/vue-tribute.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@ var VueTribute = {
handler: function handler() {
var _this = this;

var $el = this.$slots.default[0].elm;

if (this.tribute) {
this.tribute.detach($el);
setTimeout(function () {
_this.tribute = new Tribute(_this.options);
var $el = _this.$slots.default[0].elm;

_this.tribute.detach($el);

setTimeout(function () {
var $el = _this.$slots.default[0].elm;
_this.tribute = new Tribute(_this.options);

_this.tribute.attach($el);
_this.tribute.attach($el);

$el.tributeInstance = _this.tribute;
$el.tributeInstance = _this.tribute;
}, 0);
}, 0);
}
}
Expand Down
16 changes: 10 additions & 6 deletions dist/vue-tribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -1810,16 +1810,20 @@
handler: function handler() {
var _this = this;

var $el = this.$slots.default[0].elm;

if (this.tribute) {
this.tribute.detach($el);
setTimeout(function () {
_this.tribute = new Tribute(_this.options);
var $el = _this.$slots.default[0].elm;

_this.tribute.detach($el);

setTimeout(function () {
var $el = _this.$slots.default[0].elm;
_this.tribute = new Tribute(_this.options);

_this.tribute.attach($el);
_this.tribute.attach($el);

$el.tributeInstance = _this.tribute;
$el.tributeInstance = _this.tribute;
}, 0);
}, 0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-tribute.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/vue-tribute.min.js.map

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ const VueTribute = {
immediate: false,
deep: true,
handler() {
const $el = this.$slots.default[0].elm
if (this.tribute) {
this.tribute.detach($el)
setTimeout(() => {
this.tribute = new Tribute(this.options)
this.tribute.attach($el)
$el.tributeInstance = this.tribute
}, 0)
setTimeout( () => {
var $el = this.$slots.default[0].elm;
this.tribute.detach($el);

setTimeout( () => {
$el = this.$slots.default[0].elm;
this.tribute = new Tribute(this.options);
this.tribute.attach($el);
$el.tributeInstance = this.tribute;
}, 0);
}, 0);
}
}
}
Expand Down

0 comments on commit 854e0b5

Please sign in to comment.