Commit bbe623b 1 parent 99652fe commit bbe623b Copy full SHA for bbe623b
File tree 1 file changed +18
-1
lines changed
front-end/h5/src/store/modules
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * @Author : ly525
3
+ * @Date : 2019-12-08 17:05:09
4
+ * @LastEditors : ly525
5
+ * @LastEditTime : 2019-12-15 15:41:56
6
+ * @FilePath : /luban-h5/front-end/h5/src/store/modules/page.js
7
+ * @Github : https://github.com/ly525/luban-h5
8
+ * @Description : page module
9
+ * @Copyright 2018 - 2019 luban-h5. All Rights Reserved
10
+ */
11
+ import { message } from 'ant-design-vue'
12
+
1
13
import Page from '../../components/core/models/page'
2
14
3
15
// actions
@@ -29,7 +41,12 @@ export const mutations = {
29
41
state . work . pages . push ( state . editingPage . clone ( ) )
30
42
break
31
43
case 'delete' :
32
- if ( state . work . pages . length === 1 ) return // #!zh: 作品中至少需要保留一个页面,TODO 需要在页面中提示用户此信息
44
+ if ( state . work . pages . length === 1 ) {
45
+ // #!zh: 作品中至少需要保留一个页面
46
+ // #!en: At least one page needs to be kept in the work
47
+ message . info ( `作品中至少需要保留一个页面` )
48
+ return
49
+ }
33
50
34
51
const { work, editingPage } = state
35
52
let index = work . pages . findIndex ( page => page . uuid === editingPage . uuid )
You can’t perform that action at this time.
0 commit comments