解决新增商品切换页面缓存问题

This commit is contained in:
lyt
2022-12-21 18:59:19 +08:00
committed by Loki
parent ad37b47ede
commit f646ebdb0b
3 changed files with 11 additions and 5 deletions
+2
View File
@@ -0,0 +1,2 @@
import Vue from 'vue'
export default new Vue
+2 -1
View File
@@ -31,7 +31,7 @@
<script>
import ScrollPane from './ScrollPane'
import path from 'path'
import Utils from '@/assets/js/util.js';
export default {
components: { ScrollPane },
data() {
@@ -199,6 +199,7 @@ export default {
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
Utils.$emit('test');
this.$router.push(latestView.fullPath)
} else {
// now the default is to redirect to the home page if there is no tags-view,
+7 -4
View File
@@ -465,6 +465,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import MaterialList from '@/components/material'
import singlePic from '@/components/singlematerial'
import UeditorWrap from "vue-ueditor-wrap";
import Utils from '@/assets/js/util.js';
export default {
components: { editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic },
data() {
@@ -671,16 +672,18 @@ export default {
deep: true
},
$route(to,form){
console.log(to.fullPath)
if(to.fullPath=='/bxg/shop/goodsAdd'){
this.resetForm()
}else{
if(to.fullPath!=='/bxg/shop/goodsAdd'){
this.getInfo();
}
}
},
mounted () {
this.getInfo();
var that = this
Utils.$on('test', function (param) {
setTimeout(that.resetForm(),100)
})
},
methods: {
blur(index,row) {