Coder Social home page Coder Social logo

Comments (5)

arundaskd avatar arundaskd commented on May 26, 2024 4

@pstephan1187 Hi, it seems like there is a missing import

[Vue warn]: Error in created hook: "ReferenceError: Vue is not defined"
found in
---> <Datatable> at node_modules\vuejs-datatable\src\vue-datatable.vue

I added in
import Vue from 'vue'; to vue-datatable.vue
and it works perfectly fine
or
Apart from

import DatatableFactory from "vuejs-datatable"
Vue.use(DatatableFactory)

I needed to add Vue Globally like this
window.Vue = Vue;

Other than that, Great Work 👍 💯

from vuejs-datatable.

pstephan1187 avatar pstephan1187 commented on May 26, 2024 1

Yes, Vue needs to be accessible globally. The missing import is missing on purpose. With it there, the ES5 distribution will contain the Vue source code and bloat the script. I need to spend more time looking into a better fix for this because it seems to be a recurring theme.

from vuejs-datatable.

pstephan1187 avatar pstephan1187 commented on May 26, 2024

Please provide more information. Specifically, the code where you require the datatable factory and Vue.use it.

from vuejs-datatable.

pstephan1187 avatar pstephan1187 commented on May 26, 2024

I found a way to fix the "Vue not defined" error without importing Vue and thus not bloating the ES5 distribution.

from vuejs-datatable.

shakib609 avatar shakib609 commented on May 26, 2024

I found a workaround to this problem.

In your main.js simply include the DatatableFactory like this

import DatatableFactory from 'vuejs-datatable/src/classes/factory';

Vue.use(new DatatableFactory())

from vuejs-datatable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.