Commit 4e256bae by hank

修改编辑项数据限制以及提示

parent a4c93918
<template>
<div id="app">
<transition :name="transitionName" >
<keep-alive v-show="$route.meta.keepAlive">
<router-view class="child-view"/>
</keep-alive>
<router-view class="child-view" v-show="!$route.meta.keepAlive"/>
</transition>
<keep-alive v-if="$route.meta.keepAlive">
<router-view class="child-view" />
</keep-alive>
<router-view class="child-view" v-if="!$route.meta.keepAlive" />
<!-- <transition :name="transitionName" >
</transition>-->
</div>
</template>
<script>
......@@ -14,12 +14,13 @@
export default {
data() {
return {
transitionName: '',
transitionName: "",
keepAlive: false
}
};
},
watch: {
$route: function() {
console.log(this.$route.meta.keepAlive)
// let isBack = this.$router.isBack
// if (isBack) {
// this.transitionName = 'slide-right'
......@@ -32,31 +33,33 @@ export default {
// this.$router.isBack = false
}
},
created () {
created() {
if (window.history && window.history.pushState) {
history.pushState(null, null, document.URL)
history.pushState(null, null, document.URL);
window.addEventListener(
'popstate', () => {
console.log('popstate')
this.$router.isBack = true
"popstate",
() => {
console.log("popstate");
this.$router.isBack = true;
},
false
)
);
window.addEventListener(
'pushstate', () => {
console.log('pushstate')
this.$router.isBack = false
"pushstate",
() => {
console.log("pushstate");
this.$router.isBack = false;
},
false
)
);
}
}
}
};
</script>
<style lang="scss">
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
......@@ -80,7 +83,8 @@ export default {
width: 100%;
min-height: 100vh;
}
html, body {
html,
body {
min-height: 100vh;
}
.slide-left-enter,
......@@ -108,5 +112,4 @@ html, body {
transition: opacity 0.3s !important;
/* opacity: 0 !important; */
}
</style>
const getters = {
sidebar: state => state.app.sidebar,
device: state => state.app.device,
token: state => state.user.token
token: state => state.user.token,
errorData: state => state.app.errorData
}
export default getters
......@@ -5,7 +5,8 @@ const app = {
opened: !+localStorage.getItem('sidebarStatus'),
withoutAnimation: false
},
device: 'desktop'
device: 'desktop',
errorData: {}
},
mutations: {
TOGGLE_SIDEBAR: state => {
......@@ -24,6 +25,9 @@ const app = {
},
TOGGLE_DEVICE: (state, device) => {
state.device = device
},
SET_ERROR_DATA: (state, errorData) => {
state.errorData = errorData
}
},
actions: {
......
......@@ -242,6 +242,7 @@
:schemaData="templateData.listData[currentPage].schemaData"
:frameUrl="templateData.frameUrl"
:templateShow="templateData.templateShow"
:errorData="errorData"
@setList="setList"
@setClipImg="setClipImg"
></editMenu>
......@@ -347,6 +348,7 @@ export default {
defaultData: [],
templateInfo: {}
},
errorData: {},
clipImg: false,
editObj: {},
editIndex: "",
......@@ -382,7 +384,7 @@ export default {
},
watch: {
currentPage: function() { // 页面改变时 改变编辑项的索引
this.itemListIndex = 0;
this.itemListIndex = 0;
}
},
activated() { // keepalive 下显示触发
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment