|
@@ -21,10 +21,7 @@ export default {
|
|
// compile the html src (coming from parent with props or from ajax call)
|
|
// compile the html src (coming from parent with props or from ajax call)
|
|
if(this.html){
|
|
if(this.html){
|
|
// console.log('html', this.html);
|
|
// console.log('html', this.html);
|
|
- this.template = Vue.compile(this.html)
|
|
|
|
- this.$options.staticRenderFns = []
|
|
|
|
- this._staticTrees = []
|
|
|
|
- this.template.staticRenderFns.map(fn => (this.$options.staticRenderFns.push(fn)))
|
|
|
|
|
|
+ this.compileTemplate()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
render(h) {
|
|
render(h) {
|
|
@@ -35,9 +32,16 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted(){
|
|
mounted(){
|
|
- this.initShowroomCarroussel()
|
|
|
|
|
|
+ // this.initShowroomCarroussel()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ compileTemplate(){
|
|
|
|
+ this.template = Vue.compile(this.html)
|
|
|
|
+ this.$options.staticRenderFns = []
|
|
|
|
+ this._staticTrees = []
|
|
|
|
+ this.template.staticRenderFns.map(fn => (this.$options.staticRenderFns.push(fn)))
|
|
|
|
+ setTimeout(this.initShowroomCarroussel.bind(this), 250)
|
|
|
|
+ },
|
|
initShowroomCarroussel(){
|
|
initShowroomCarroussel(){
|
|
console.log("startShowroomCarroussel");
|
|
console.log("startShowroomCarroussel");
|
|
this.showrooms = document.querySelectorAll('.field--name-computed-showrooms-reference > .field__item')
|
|
this.showrooms = document.querySelectorAll('.field--name-computed-showrooms-reference > .field__item')
|
|
@@ -131,6 +135,12 @@ export default {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ html: function(val) {
|
|
|
|
+ console.log('html prop changed', val)
|
|
|
|
+ this.compileTemplate()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|