我有4个选择。如果我单击一个选项来更改我的分区中的样式
我在console.log()上用setinterval()尝试了它,它正确地显示了我的值,但是Vue JS不更新它。
<div v-bind:style="{'box-shadow': schatten, width: breite, height: hoehe, 'text-align': center, margin: mitte, padding: abstand, background: backcolor}">
setInterval(function(){
var e = document.getElementById("selection");
var strUser = e.options[e.selectedIndex].value;
var box = new Vue({
el: '#anmeldebox',
data: {
schatten: '0px 0px 25px black',
breite: '400px',
hoehe: '200px',
center: 'center',
mitte: '0 auto',
abstand: '20px',
backcolor: strUser
}
});
}, 3000);
所以struser得到了另一个值,但它仍然不更新