Vue introduces third-party files (Gao Pai), passing values and calling interfaces.

Vue imports third-party files are usually placed in the public static directory of the root directory:

Example jQuery file:

 Next, enter the main topic, which is our Gaopai file (also put it in the public static directory):

After the introduction, I usually import it into the vue component  through the ifram tag

 The src path of the ifram tag (introduced according to the relative path of the index.js file of vue under the static directory public)

The third party (Gao Paiyi) passes the value to the vue component:

 1. The third party (Gao Pai) passes the value to the vue component through parent.getFromIframe("incoming information")

2. Reference the method in the vue instance to the window object 

 

3. Receive the passed value by calling the instance method

 Get the photo result and upload it to the server

1. Pass the photo image (base64 format) to the vue page

 

2. Get the picture taken and decode it and upload it to the server

 

 If it is useful, please like it, follow it and add to favorites (。・ω・。)ノ♡

Guess you like

Origin blog.csdn.net/CCKing7/article/details/126908114