<script type="extension/settings" name="user">{"token":""}</script>
cities.forEach(element => {
let newElement = JSON.parse(JSON.stringify(element))
newElement.city = prb(newElement.city, searchSring.toLowerCase())
if ((newElement.city).length>0){
arr.push(newElement)
}
});
<div class="tab">
<component
v-bind:is="activeTabComponent"
v-model="values"
></component>
</div>
APP.popup = function (component,props) {
let mount_poiunt = document.createElement('div');
document.body.append(mount_poiunt);
var props = {
'component':component,
'props':props
}
var Popup = Vue.extend({
data: function () {
return props
},
destroyed () {
this.$el.remove()
},
methods: {
close: function () {
this.$destroy()
}
},
template: `<div class="popup">
<span v-on:click="close" class="close">✖</span>
<component v-bind:is="component" v-on:close="close" v-bind="props"/>
</div>`
})
new Popup().$mount(mount_poiunt)
};
APP.popup('имяКомпонентаКоторыйНадоПоказатьВПопапе', {параметрыЭтогоКомпонента});
Требуется перерисовывать компонент каждый раз, когда приходят новые данные, как реализовать?
this.firstWindow = Object.assign({}, this.firstWindow, data);
methods:{
newvalue(data, whichScreen){
if(whichScreen){
console.log("попал");
console.log(data);
Vue.set(this.windows, 'firstWindow', Object.assign({}, this.firstWindow, data));
}else{
Vue.set(this.windows, 'secondWindow', Object.assign({}, this.secondWindow, data));
}
}
}