Skip to content

Commit

Permalink
Merge pull request #26 from tzolkincz/master
Browse files Browse the repository at this point in the history
fix undefined default slot  when rendering complex components
  • Loading branch information
syropian committed Feb 9, 2020
2 parents 8a1e75d + 1e3ef21 commit c459034
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 30 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ cache:
yarn: true
directories:
- node_modules
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
services:
- xvfb
sudo: false
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 c459034

Please sign in to comment.