@@ -448,6 +448,10 @@ export default {
.v-modal {
display: none !important;
}
+/* 保留 $confirm / MessageBox 的遮罩 */
+.el-message-box .v-modal {
+ display: block !important;
+}
.layout-container {
height: 100vh;
@@ -135,6 +135,29 @@ export default {
this.loadDetail(id)
},
+ beforeRouteLeave(to, from, next) {
+ // 离开前清空表单数据,避免浏览器弹出"离开页面?未保存更改"原生提示
+ this.form = {
+ id: null,
+ categoryId: '',
+ title: '',
+ summary: '',
+ coverImage: '',
+ content: '',
+ tags: '',
+ author: '',
+ readTime: 3,
+ relatedDimensions: [],
+ dimensionWeights: [],
+ visibility: 'public',
+ visibleTo: []
+ }
+ this.isEdit = false
+ this.loading = false
+ this.saving = false
+ this.publishing = false
+ next()
+ },
methods: {
async loadCategories() {
try {