search

Home  >  Q&A  >  body text

node.js - 如何在vue模板中使用nodeJS?

ringa_leeringa_lee2872 days ago674

reply all(2)I'll reply

  • 迷茫

    迷茫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环境中,是有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.

    reply
    0
  • 天蓬老师

    天蓬老师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.

    reply
    0
  • Cancelreply