vue删除刷新页面
<template>
<v-app dark
class="main-app">
<Footer />
<v-main class="bg">
<router-view v-if="isRouterAlive"/>
</v-main>
</v-app>
</template>
<script>
import Footer from "@/components/Notifications";
import { getServerKey } from './api/http'
export default {
name: "App",
provide(){
return{
reload:this.reload
}
},
components: {
Footer,
},
data () {
return {
isRouterAlive:true
};
},
mounted: function () {
},
methods: {
reload(){
this.isRouterAlive = false;
this.$nextTick(function (){
this.isRouterAlive = true;
})
}
}
};
</script>
<template>
<v-app>
<v-main>
删除vue,刷新数据
</v-main>
</v-app>
</template>
<script>
import {threeDelete} from "@/api/home";
export default {
name: 'Home',
inject: ['reload'],
data () {
return {
}
},
methods: {
deleteBtn(id){
let that = this;
//每次删除之前 应该清空数组
that.ids.push(id);
console.log(that.ids);
threeDelete(that.ids).then(function (res) {
console.log(res)
that.reload()
}).catch(function (error) {
console.log('error:', error)
})
},
}
}
</script>