坑1. api接口不通叛买,報(bào)錯(cuò)net::ERR_CLEARTEXT_NOT_PERMITTED
解決:
修改config.xml中的兩段內(nèi)容
<widget id="you-app-id" version="1.2.3"
xmlns="http://www.w3.org/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:cdv="http://cordova.apache.org/ns/1.0">
<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
<application android:usesCleartextTraffic="true" />
</edit-config>
</platform>
坑2. import何時(shí)加{}和不加
解釋:
使用export拋出的變量钟哥,需要用{}引入
使用export default拋出的變量,可以直接引入
一個(gè)文件里只能有一個(gè)export default镐躲,而export可以有多個(gè)