Comments (9)
@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.
Follow-up: if I just use
import VueGoodTable from 'vue-good-table/src/components/table.vue';
the component is working.
from vue-good-table.
hmm this is strange. I haven't been able to reproduce this yet. Will continue digging.
from vue-good-table.
Ok, let me know if I can provide any more info or help.
from vue-good-table.
@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.
@cristijora with the answers! Thanks! will update.
from vue-good-table.
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.
added the following:
export {
GoodTable as VueGoodTable
};
Tested and released: v1.7.1
from vue-good-table.
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)
- Execute a function once when the dropdown is changed
- How do I add a new row?
- Property "$createElement" was accessed during render but is not defined on instance.
- Highlight search queries
- filter doesn't work in some columns
- Action button not showing when selecting a record using checkbox
- (vue-good-table-NEXT): Unable to dynamically set hidden column value
- searchFn not trigger when clean search key HOT 2
- Is this project active any longer? HOT 3
- 2 Data in 1 Row SearchFilter
- Not fully supported for RTL language HOT 1
- Preserving Selected Rows After Filtering HOT 1
- How to scroll to a specific line on vue good table HOT 4
- Cannot run app with basic table HOT 2
- mode='remote' + dropdownAllowAll enabled and selected >> total changes we should keep currentPerPage to -1
- Editable Component Value Propagation Issue
- Won't render using ts
- Updating the table when row data changes after AJAX requeset
- Customization of the checkboxes
- Style slot cannot be closed after setting table-actions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-good-table.