Why axios? cannot be introduced with js files

A problem encountered in the process of learning vue: a server is simulated locally, and the data can be accessed by entering the address. When writing the port with the js file, I found that my js is different from the tutorial. The version number of my js is 0.17.1

.
Mar.20,2021

import is introduced. It must be in the outermost layer. Code blocks are not allowed to wrap


.

is that how you introduced it? write it on the export default {} outside

.

require can not be written on the outer layer, import must write

on the outer layer.
Menu