Home  >  Article  >  Web Front-end  >  Can vue display source code?

Can vue display source code?

藏色散人
藏色散人Original
2023-01-05 15:17:023094browse

vue can display the source code. The method of viewing the source code of vue is: 1. Get vue through "git clone https://github.com/vuejs/vue.git"; 2. Install through "npm i" Dependencies; 3. Install rollup through "npm i -g rollup"; 4. Modify the dev script; 5. Just debug the source code.

Can vue display source code?

#The operating environment of this tutorial: Windows 10 system, Vue version 3, Dell G3 computer.

Can vue display the source code?

able.

Vue tips for viewing source code

##Build and debug Environment

    Get address: git clone https://github.com/vuejs/vue.git
  • Install dependencies: npm i
  • Install rollup: npm i -g rollup (because it is packaged with rollup)
  • script modify the dev script and add –sourcemap
"dev": "rollup -w -c scripts/config.js --sourcemap --environment TARGET:web-full-dev",
Function: After packaging, there are more map files in dist, which can be compared with the source code Very good mapping, convenient and better debugging source code


Can vue display source code?

    Execute dev: npm run dev

Debugging skills

    Open the specified file: ctrl p (cmd p)
  • Breakpoint

Can vue display source code?

  • Check the call stack

    I especially want to clear up the relationship between previous calls. Sometimes I get confused if I go too deep, so study the call stack carefully. It can give you a good idea

Can vue display source code?

  • Locate the location of the source file

Can vue display source code? After mastering the above, After reading it more times, the execution of the source code will be very clear in my mind.

Recommended learning: "

vue video tutorial"

The above is the detailed content of Can vue display source code?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn