umbrella22

更新说明

...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 6
7 <script> 7 <script>
8 export default { 8 export default {
9 - name: 'my-project' 9 +
10 } 10 }
11 </script> 11 </script>
12 12
......
...@@ -43,16 +43,18 @@ export default { ...@@ -43,16 +43,18 @@ export default {
43 textarray: [] 43 textarray: []
44 }), 44 }),
45 methods: { 45 methods: {
46 - open(link) { 46 + // 获取electron方法
47 - this.textarray.length 47 + open() {
48 console.log(this.$electron); 48 console.log(this.$electron);
49 }, 49 },
50 + // 设置数据库的数据
50 setdata() { 51 setdata() {
51 this.$db 52 this.$db
52 .adddata(this.newdata) 53 .adddata(this.newdata)
53 - .then(res => console.log(res)) 54 + .then(res => this.getdata())
54 .catch(err => console.log(err)); 55 .catch(err => console.log(err));
55 }, 56 },
57 + // 获取数据库的数据
56 getdata() { 58 getdata() {
57 this.$db 59 this.$db
58 .finddata() 60 .finddata()
...@@ -63,6 +65,7 @@ export default { ...@@ -63,6 +65,7 @@ export default {
63 }) 65 })
64 .catch(err => console.log(err)); 66 .catch(err => console.log(err));
65 }, 67 },
68 + // 清空数据库的数据
66 deledata(){ 69 deledata(){
67 // dialog为electron实例,data则是显示需要的参数,fun是需要执行的函数,此选项不是为必选的 70 // dialog为electron实例,data则是显示需要的参数,fun是需要执行的函数,此选项不是为必选的
68 const dialog = this.$electron.remote.dialog 71 const dialog = this.$electron.remote.dialog
...@@ -73,7 +76,12 @@ export default { ...@@ -73,7 +76,12 @@ export default {
73 } 76 }
74 const fun = this.$db.deleall({name:'yyy'}) 77 const fun = this.$db.deleall({name:'yyy'})
75 api.MessageBox(dialog,data,fun).then(res=>{ 78 api.MessageBox(dialog,data,fun).then(res=>{
76 - console.log(res) 79 + this.getdata()
80 + this.$message({
81 + showClose: true,
82 + message: '成功删除'+res+'条',
83 + type: 'success'
84 + });
77 }) 85 })
78 }, 86 },
79 } 87 }
......
...@@ -27,5 +27,6 @@ export default { ...@@ -27,5 +27,6 @@ export default {
27 } 27 }
28 }) 28 })
29 }) 29 })
30 - } 30 + },
31 +
31 } 32 }
...\ No newline at end of file ...\ No newline at end of file
......