Thanks for the invitation. After reading the question, I was a little confused. Why should I write Notepad in the .vue file? .vue file will eventually be compiled and compressed into a js file, and finally used in the browser environment. There must be no fs module. Do you want to store it on the user's machine? fs模块的,莫非你是想存在用户的机器上? 而webpack.config.js是脚手架里的文件,运行在nodejs环境中,是有fsAnd webpack.config.js is a file in the scaffolding. It runs in the nodejs environment and has the fs module. If you want to Server side, then this step should be to send a request to the backend to save the notepad.
You must first understand that vue is the front-end field, while node.js is the back-end field. Although they are both js, they can do completely different things.
Thanks for the invitation. After reading the question, I was a little confused. Why should I write Notepad in the .vue file?
.vue file will eventually be compiled and compressed into a js file, and finally used in the browser environment. There must be no
fs
module. Do you want to store it on the user's machine?fs
模块的,莫非你是想存在用户的机器上?而
webpack.config.js
是脚手架里的文件,运行在nodejs
环境中,是有fs
Andwebpack.config.js
is a file in the scaffolding. It runs in thenodejs
environment and has thefs
module. If you want to Server side, then this step should be to send a request to the backend to save the notepad.You must first understand that vue is the front-end field, while node.js is the back-end field. Although they are both js, they can do completely different things.