小编ron*_*man的帖子

如何初始化多个 Firebase 项目

我正在尝试在 React 中初始化多个 Firebase 项目,但收到一个奇怪的错误,提示 \xc3\x97\n`Firebase:名为 \'[DEFAULT]\' 的 Firebase 应用程序已存在(应用程序/重复应用程序)。

\n\n

我选择了一个完全不同的字符串,但它仍然不起作用。有人可以解释一下我做错了什么吗?谢谢您的帮助!

\n\n

参考.js

\n\n
import * as firebase from "firebase";\n\n\n\n  var config = {\n    apiKey: "AIzaSyDsTsClk8l2l5yLNu_eG-R06Usv4Oi_NvQ",\n    authDomain: "d-ucukgx.firebaseapp.com",\n    databaseURL: "https://d-ucukgx.firebaseio.com",\n    projectId: "d-ucukgx",\n    storageBucket: "d-ucukgx.appspot.com",\n    messagingSenderId: "1031835936266"\n  };\n  firebase.initializeApp(config);\n\n\n\n  const databaseRef = firebase.database().ref();\nexport const ChampsRef = databaseRef.child("Champs");\n\n\nexport const authRef = firebase.auth();\nexport const timeRef = firebase.database.ServerValue.TIMESTAMP;\n\nexport default databaseRef;\n
Run Code Online (Sandbox Code Playgroud)\n\n

配置/dev.js

\n\n
import * as firebase from "firebase";\n\n\n\n  var firebaseConfig2 = {\n    apiKey: "AIzaSyDsTsClk8l2l5yLNu_eG-R06Usv4Oi_NvQ",\n    authDomain: "d-ucukgx.firebaseapp.com",\n    databaseURL: "https://d-ucukgx.firebaseio.com",\n    projectId: "d-ucukgx",\n    storageBucket: "d-ucukgx.appspot.com",\n …
Run Code Online (Sandbox Code Playgroud)

javascript firebase

3
推荐指数
1
解决办法
4633
查看次数

如何在数组中向左旋转元素?

我正在尝试向左旋转数组,例如rotateLeft3([1,2,3])→[2,3,1]

这是我的解决方案,但由于某种原因它不起作用.有人可以解释一下我做错了什么吗?

#include <iostream>

using namespace std;

int main()
{
    bool six;
    int Array[3] = { 1,2,3 };
    int x = sizeof(Array) / sizeof(Array[0]);
    int temp = Array[0];
    int temp2;
    for (int i = 0; i < x; i++)
    {
        Array[i] = Array[i + 1];
        Array[x - 1] = temp;
    }
    for (int i = 0; i < 3; i++)
    {
        cout << Array[i] << endl;
    }
    system("pause");

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

c++

2
推荐指数
1
解决办法
4595
查看次数

提供给“GoogleMap”的道具“center”无效。React.js

我试图使用谷歌地图反应库初始化谷歌地图,并希望每次我根据纬度和经度状态搜索位置时地图都会改变。但是我收到一个错误,说提供给谷歌地图的道具中心无效。出于某种原因,当我放置一个数字而不是 this.state 时它会起作用......有人可以帮忙吗?

应用程序.js

 import React, { Component } from 'react';
    import axios from "axios";
    import './App.css';
    import PlacesAutocomplete from 'react-places-autocomplete'
    import { geocodeByAddress, geocodeByPlaceId, getLatLng } from 'react-places-autocomplete'
    import UserForm from "./components/UserForm.js";

    import Super from "./components/super.js";


    import MapContainer from './components/Map.js'
    import Map from './components/Map.js';
    import { classnames } from './components/helpers';

    const google = window.google;



    class App extends Component {
     constructor() {
        super();
        this.state = {
          zoom: 13,
          maptype: 'roadmap',
          place_formatted: '',
          place_id: '',
          place_location: '',
          address: '',
          latitude: '37.774929', …
Run Code Online (Sandbox Code Playgroud)

google-maps reactjs

1
推荐指数
1
解决办法
987
查看次数

标签 统计

c++ ×1

firebase ×1

google-maps ×1

javascript ×1

reactjs ×1