我创建了一个计算属性,它是一个值数组并创建了一个 滚动显示器 负责通过添加更多值来更新属性,但是我 注意到的是 信息在dom中更新,但它不会在页面中更新。 我真的不知道为什么
<!-- myCode -->
<template>
<div class="u" >
<div class="makeit" v-for="search in Searched" >
<img :src=' "Images/Houses/" + search.image' width="200px"
class="xz" />
</div>
</div>
<div id="mmm" class="Mola" > More results</div>
</div>
</template>
<script>
export default{
computed :{
Searched(){
return this.$store.state.Searched.slice(0,8);
}
},
methods:{
done(){
if(this.Searched.length < this.$store.state.Searched.length){
let added= this.$store.state.Searched
.slice(this.Searched.length,this.Searched.length+8);
added.map(added=>this.Searched.push(added));
}
},
mounted(){
var g = this;
var y = document.getElementById("mmm");
var e = scrollMonitor.create(y);
e.enterViewport(()=>{
g.done()
});
}
}
</script>