Current location - Quotes Website - Collection of slogans - Cann't use Vue-amap intranet deployment.
Cann't use Vue-amap intranet deployment.
You need to configure it before you can access it directly using LAN IP. The method is as follows:

Add the-host 0.0.0.0 attribute to dev, so that you can access the IP of the computer with your mobile phone and directly open the project website. If it is still inaccessible, you need to configure the computer's firewall and open the required port (such as 8080).

The setting method is as follows: Windows 10, search "Control Panel" and open it. Windows 7 can be opened directly in the start menu. Click Windows Defender Firewall-Advanced Settings-New Network Access Rule. Select "port" as the rule type and fill in 8080-8088 (here is an IP segment, because if multiple projects are opened, the port will be occupied, and Vue will automatically assign a new port. Such as: 808 1).

The next step is "Allow Connection". The next step is to choose an open scene. I chose the first two. The next step is to enter a name for the rule, and then click Finish. In this way, access the computer IP with a mobile phone and add the port number192.168.5438+0.1:8080 to open the project. How to get the computer IP: Win+R runs "cmd", enters ipconfig and returns, and you can see your own IP.

In LBS-based applications, we often deal with maps. The most direct solution, of course, is to go to the corresponding map official website to find documents, and then play step by step. For simple scenes, the experience should be good, but for some complex scenes with many states and frequent changes, it is really a headache not only to keep the local data state synchronized with the map state at all times, but also to find the map API for setting various states. The original intention of designing vue-amap is to free developers from the search of numerous map APIs and the tedious synchronization of map status when writing map applications.