VUE project dependent on the introduction of third-party error Uncaught SyntaxError: Unexpected token <

Daily step on pit essay hoping to help everyone

 

 The figure is the problem?

Introducing jquery, js error, why? So I went through a lot of information;

The problem of static resources

The following are answers to pro-test results data access or not;

The solution is to rely on third-party JS files into the / static under / utils directory, introducing path also changed: <script src = "./ static / utils / sockjs.js"> </ script>, so that no error up!

1, assets folder difference between static folder

A difference: assets file is that it is necessary to package the final run in src, and static files do not need to pack directly on the final document

Difference between the two: ../ performed with this form of assets in the relative path of the file vue template / style reference, and must be introduced anywhere in a static file in script .vue in a manner @import As long as this embodiment are used ../ relative path is introduced,

2、

(1) assets used to place style, still images, as long as the src components used in the following resources are placed in assets.

(2) static npm package to put no third-party plug-ins, font files.

When (3) assets referenced in static files and .vue components similar components, the relative path is ../assets/wapFront

3, vue how to introduce other static file:

(1) resources under src directory can only import or require.

(2) wants to introduce static, then the establishment of a directory and src same level such as static, then the static resource into the folder, the introduction path html as follows: ./ static / ... (Note: must be tried on the static folder, otherwise an error)

 

Then I had an idea directly put him inside public

 

 Then just fine, they are not being given the hope of help to you

 

 magical

Guess you like

Origin www.cnblogs.com/10ve/p/12132353.html