Error in ElectronJs and Vuejs

0

I am developing an application with ElectronJS and Vuejs but when I want to connect it and download data with Firebase it tells me this error:

Step part of Vuejs code:

const remote = require('electron').remote
const main = remote.require('./main.js')
var firebase = require('firebase')
const toastr = require('toastr')
const menu = main.Menu

    // Initialize Firebase
    var config = {
        apiKey: "",
        authDomain: "",
        databaseURL: "",
        projectId: "",
        storageBucket: "",
        messagingSenderId: ""
    };

    let apps = firebase.initializeApp(config);
    let mdb = apps.database();

    let tidenti = mdb.ref('tipo_identificacion');

    new Vue({
        el: '#ausuario',
        firebase: function () {
            return {
                tipodentidad: tidenti
            }
        },
        components: {
            // <my-component> solo estará disponible en la plantilla del padre
            'e-mainmenu': menu,
        },

Here is where you should show the data in the HTML:

 <v-flex xs6>
    <v-select 
      v-model="auser.tipoide" 
      v-for="item in tipodentidad" 
      :key="item.id"                
      :rules="[v => !!v || 'Dato es requerido']"
      label="Tipo de identificacion" required>
     </v-select>
</v-flex>

So I call the app:

   <script src="https://www.gstatic.com/firebasejs/5.4.2/firebase.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">

</head>

<body>

    <div id="ausuario" >
        <v-app>
            <e-mainmenu></e-mainmenu>
            <v-content>
                <v-container>
                    <v-container grid-list-md text-xs-center>
                        <v-form ref="form" v-model="valid" @submit.prevent="registrarUsuario" lazy-validation>
                            <v-layout row wrap>
                                <v-flex xs12>
                                    <v-card dark color="primary">
                                        <v-card-text class="px-0">Agregar usuario al sistema</v-card-text>
                                    </v-card>
                                </v-flex>
                                <v-flex xs6>
    
asked by Nahuel Jakobson 11.09.2018 в 16:35
source

1 answer

0

Solution: Install VueFire, the error was not in the data {}. Or you can solve it by placing the following links in etre the labels <head></head>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/vuefire/dist/vuefire.js"></script>
<script src="https://www.gstatic.com/firebasejs/5.4.2/firebase.js"></script>
    
answered by 12.09.2018 в 22:55