Skip to content

Constructor must be called with the new operator #5

@bubnenkoff

Description

@bubnenkoff

When I am trying to add vis-network not in main component I am getting error: Constructor must be called with the new operator

<template>
    <el-container >
            <el-main>

                <network ref="network" :nodes="nodes" :edges="edges" :options="options"> </network>                        

                 <button @click="get_data">GetData</button>

            </el-main>
	</el-container>
</template>

<script>
    export default {
    	components: { Notification },
        data () {
            return {
              nodes: [],
              edges: [],
              options: []
            }
        },

        methods:
        {
          get_data()
          {

            axios.get(base_url + '/graph')
               .then((response) => {
                this.nodes = response.data.nodes;
                this.edges = response.data.edges;
                }).catch((error) => {
                          console.log(error);
                        });  
          
          }

        },
    }
</script>

index.js:

import vueVisNetwork from 'vis-network'

import locale from 'element-ui/lib/locale/lang/ru-RU'
window.axios = require('axios');
Vue.use(ElementUI, { locale })
Vue.use(Router)
Vue.component('network', vueVisNetwork.Network);

window.base_url = "http://127.0.0.1:8000"

new Vue({
  el: '#app',
  locale: 'ru',
  render: h => h(App)
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions