我在路由器文件中删除了历史模式链接中的hashbang.现在,当我刷新页面时,我收到了404错误.
我试着按照这个链接
然后,我在firebase.json中添加了部分:
{
"hosting": {
"public": "dist",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
然而一切都没有改变.
我不明白为什么我还有这个错误.我尝试了很多东西,但我找不到解决它的东西.
这是我的路由器文件:
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/',
redirect: '/catalog'
},
{
path: '/catalog',
name: 'Catalog',
component: Catalog
},
{
path: '/catalog/category/:category',
name: 'ProductsList',
component: ProductsList
},
{
path: '/catalog/category/:category/product/:id',
name: 'ProductDetail',
component: ProductDetail,
},
{
path: '/catalog/category/:category/product/create',
name: 'CreateProduct',
component: CreateProduct
}
]
});
Run Code Online (Sandbox Code Playgroud) 当我使用依赖项构建(> react-native run-android)时,构建成功!但是,当应用程序启动时,它立即崩溃...怎么不知道怎么可能,没有错误,没什么可告诉我为什么应用程序崩溃了...
确保它来自依赖项...
dependencies {
implementation project(':react-native-intercom')
implementation "io.intercom.android:intercom-sdk:3.+"
implementation project(':react-native-onesignal')
implementation 'com.google.android.gms:play-services-location:+'
implementation project(':react-native-linear-gradient')
implementation project(':react-native-i18n')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"
implementation project(':tipsi-stripe')
implementation (project(':react-native-maps')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
implementation (project(':react-native-camera')) {
exclude group: "com.google.android.gms"
exclude group: "com.android.support", module: 'support-v4'
}
implementation "com.android.support:appcompat-v7:23.0.1"
implementation 'com.google.android.gms:play-services-base:10.0.1'
implementation 'com.google.android.gms:play-services-maps:10.0.1'
implementation 'com.google.android.gms:play-services-gcm:10.0.1'
}
Run Code Online (Sandbox Code Playgroud)
非常感谢
android google-play-services react-native react-native-android