我的vue文件是
<template>
html代码等
</template>
<script >
export default {
name: "HelloWorldd",
data() {
return {
msg: "Welcome",
};
},
mounted() {
this.show2 = true;
this.mywindow.electron.doThing()
},
methods: {
//这个btnc 是个点击事件
btnc(event) {
// 这个fs,我这样用会报错 fs is not defined
fs.readFile('test.txt',(err,data)=>{
console.log(data)
})
// this.mywindow.fs.readFile('xiaojiejie.txt',(err,data)=>{
//
// this.ss=data
//
// })
}
},
};
</script>
这种样子的。