切换导航条
切换导航条
当前项目
正在载入...
登录
术习电报
/
electron-vue-template
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
作者
umbrella22
2019-03-27 16:19:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
提交
56f5ad2e6eea90b402a06dcdc2ae2c1f2a0bb499
56f5ad2e
1 个父辈
da5bc398
更新说明
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
6 行删除
src/renderer/App.vue
src/renderer/components/LandingPage.vue
src/renderer/tools/dialog.js
src/renderer/App.vue
查看文件 @
56f5ad2
...
...
@@ -6,7 +6,7 @@
<script>
export default {
name: 'my-project'
}
</script>
...
...
src/renderer/components/LandingPage.vue
查看文件 @
56f5ad2
...
...
@@ -43,16 +43,18 @@ export default {
textarray: []
}),
methods: {
open(link) {
this.textarray.length
// 获取electron方法
open() {
console.log(this.$electron);
},
// 设置数据库的数据
setdata() {
this.$db
.adddata(this.newdata)
.then(res =>
console.log(res
))
.then(res =>
this.getdata(
))
.catch(err => console.log(err));
},
// 获取数据库的数据
getdata() {
this.$db
.finddata()
...
...
@@ -63,6 +65,7 @@ export default {
})
.catch(err => console.log(err));
},
// 清空数据库的数据
deledata(){
// dialog为electron实例,data则是显示需要的参数,fun是需要执行的函数,此选项不是为必选的
const dialog = this.$electron.remote.dialog
...
...
@@ -73,7 +76,12 @@ export default {
}
const fun = this.$db.deleall({name:'yyy'})
api.MessageBox(dialog,data,fun).then(res=>{
console.log(res)
this.getdata()
this.$message({
showClose: true,
message: '成功删除'+res+'条',
type: 'success'
});
})
},
}
...
...
src/renderer/tools/dialog.js
查看文件 @
56f5ad2
...
...
@@ -27,5 +27,6 @@ export default {
}
})
})
}
},
}
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论