Giter VIP home page Giter VIP logo

Comments (9)

cristijora avatar cristijora commented on May 31, 2024 2

@dawgavins if you import VueGoodTable from 'vue-good-table you have to install it as a plugin
Vue.use(VueGoodTable)
Directly using the component in this case without installing it (Vue.use) will not work because the main file is basically a plugin install while vue-good-table/src/components/table.vue is the component itself

@xaksis You can do this in index.js

import GoodTable from './components/Table.vue';
//plugin instalation code
export default GoodTablePlugin;
export {
  VueGoodTable: GoodTable
}

//other installation code for window

Which will allow the following:

import {VueGoodTable} from 'vue-good-table'

//usage locally
components:{
 VueGoodTable
}

//template
<vue-good-table></vue-good-table>

from vue-good-table.

dawgavins avatar dawgavins commented on May 31, 2024

Follow-up: if I just use
import VueGoodTable from 'vue-good-table/src/components/table.vue';
the component is working.

from vue-good-table.

xaksis avatar xaksis commented on May 31, 2024

hmm this is strange. I haven't been able to reproduce this yet. Will continue digging.

from vue-good-table.

dawgavins avatar dawgavins commented on May 31, 2024

Ok, let me know if I can provide any more info or help.

from vue-good-table.

xaksis avatar xaksis commented on May 31, 2024

@dawgavins can you post some code as to how you're trying to load it into your app when you see that error?

from vue-good-table.

xaksis avatar xaksis commented on May 31, 2024

@cristijora with the answers! Thanks! will update.

from vue-good-table.

dawgavins avatar dawgavins commented on May 31, 2024

Sorry for the delay in responding. @cristijora nailed it....the local usage posted at the bottom was exactly what I was trying to do.

I verified that it also works if I use
Vue.use(VueGoodTable)

I had tried that before, but I think I might have left something else in my code (possibly listing VueGoodTable as a local component) that caused an error. But it does work, and is probably cleaner than specifying the path to the component as per my first workaround. Of course cristijora's suggestion will be the best overall once its in.

Thanks everyone!

from vue-good-table.

xaksis avatar xaksis commented on May 31, 2024

added the following:

export {
   GoodTable as VueGoodTable
};

Tested and released: v1.7.1

from vue-good-table.

adavie1 avatar adavie1 commented on May 31, 2024

The lines:

import 'vue-good-table/dist/vue-good-table.css'
import VueGoodTable from 'vue-good-table'
Vue.use(VueGoodTable)

Solve the issue for me.

from vue-good-table.

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.