vue项目刷新浏览器使用代码插入的url链接会被取消,但是再次刷新就会重新加载(也有出现加载出一部分的情况。如果我使用分页去请求图片没有任何问题。所以问题就是为什么刷新就链接被取消
<el-row style="height: 200px">
<el-carousel class="carousels">
<el-carousel-item v-for="(item, index) in item" :key="index">
<img v-bind:src='item' width="100%">
el-carousel-item>
el-carousel>
el-row>
<el-row :span=24>
<el-col :offset="1" :span=6 v-for="(pageDatas, index) in pageData" :key="index" style="height: 50px;margin-top: 120px" shadow="hover">
<el-card :body-style="{ padding: '0px'}">
<img ref="aa" :src='pageDatas.imgsrc' class="image">
<p style="float: left;line-height:120%;margin-left: 10px;font-size: 16px;width: 140px;padding-bottom: 10px">{{ pageDatas.title }}p>
<p style="float: left;line-height:1150%;margin-left: -200px;margin-top: 40px;width: 200px;font-size: 10px">{{ pageDatas.source }}p>
<p style="float: right;line-height:1150%;margin-right: 10px;margin-top: 40px;font-size: 10px">{{ pageDatas.ptime }}p>
el-card>
el-col>
el-row>
pagehelper(){
console.log(this.pageTotal)
},
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
this.pageData=[]
let a=0;
for (let i=(val-1)*6;i<(val-1)*6+6;i++){
this.pageData[a]=this.newData[i];
a++;
}
console.log(this.pageData);
},
stop(){
var mo = function(e){
e.preventDefault
}
document.body.style.overflow = "hidden"
document.addEventListener("touchmove",mo,false)
}
},
moutned(){
console.log(11)
},
beforeUpdate(){
if (this.pageData.length==0){
let a=0;
for (let i=0;i<6;i++){
this.pageData[a]=this.newData[i];
this.pageDataimg[a]=this.newData[i].imgsrc;
a++;
}
console.log( this.pageDataimg)
}
},
created() {
axios.get("/api/nc/article/headline/T1348647853363/0-40.html").then(res=>{
if (res.data){
this.newData=res.data.T1348647853363
this.pageTotal=this.newData.length
}
})
},
updated() {
stop()
}
你的意思是刷新网页就会无法访问了是吧?vue在开发环境下没有刷新功能,必须要打包后部署到例如apache、nginx这些应用服务器上之后才可以支持刷新