迷茫2017-04-17 15:55:31
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
And 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.
天蓬老师2017-04-17 15:55:31
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.