Browse Source

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

master
lyt 2 years ago committed by Loki
parent
commit
f646ebdb0b
  1. 2
      src/assets/js/util.js
  2. 3
      src/layout/components/TagsView/index.vue
  3. 11
      src/views/bxg/shop/goods/form.vue

2
src/assets/js/util.js

@ -0,0 +1,2 @@
import Vue from 'vue'
export default new Vue

3
src/layout/components/TagsView/index.vue

@ -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,

11
src/views/bxg/shop/goods/form.vue

@ -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) {

Loading…
Cancel
Save