Error: Layout must be an array!
See original GitHub issueI’m getting the error Error: Layout must be an array! when I try to incorporate the library into my application. I added the code here:
`<script>
import SystemInformation from './LandingPage/SystemInformation'
import VueGridLayout from 'vue-grid-layout';
var GridLayout = VueGridLayout.GridLayout;
var GridItem = VueGridLayout.GridItem;
var testLayout = [
{"x":0,"y":0,"w":2,"h":2,"i":"0"},
{"x":2,"y":0,"w":2,"h":4,"i":"1"},
{"x":4,"y":0,"w":2,"h":5,"i":"2"},
{"x":6,"y":0,"w":2,"h":3,"i":"3"},
{"x":8,"y":0,"w":2,"h":3,"i":"4"},
{"x":10,"y":0,"w":2,"h":3,"i":"5"},
{"x":0,"y":5,"w":2,"h":5,"i":"6"},
{"x":2,"y":5,"w":2,"h":5,"i":"7"},
{"x":4,"y":5,"w":2,"h":5,"i":"8"},
{"x":6,"y":4,"w":2,"h":4,"i":"9"},
{"x":8,"y":4,"w":2,"h":4,"i":"10"},
{"x":10,"y":4,"w":2,"h":4,"i":"11"},
{"x":0,"y":10,"w":2,"h":5,"i":"12"},
{"x":2,"y":10,"w":2,"h":5,"i":"13"},
{"x":4,"y":8,"w":2,"h":4,"i":"14"},
{"x":6,"y":8,"w":2,"h":4,"i":"15"},
{"x":8,"y":10,"w":2,"h":5,"i":"16"},
{"x":10,"y":4,"w":2,"h":2,"i":"17"},
{"x":0,"y":9,"w":2,"h":3,"i":"18"},
{"x":2,"y":6,"w":2,"h":2,"i":"19"}
];
export default {
name: 'landing-page',
data: {
layout: testLayout
},
components: { SystemInformation, GridItem, GridLayout },
methods: {
open (link) {
this.$electron.shell.openExternal(link)
}
},
}
</script>`
Why is it giving out 😕?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
react-grid-layout - Failed prop type: Layout property must be ...
I have followed the guide at react-grid-layout and I am still getting this error message.
Read more >Argument 1 passed to Drupal\Core\Layout\LayoutDefault ...
TypeError: Argument 1 passed to Drupal\Core\Layout\LayoutDefault::build() must be of the type array, null given, called in /var/www/myProject/ ...
Read more >Warning: count(): Parameter must be an array or an object…
Error message: Warning: count(): Parameter must be an array or an object… I am using wordpress 5.5. 1, so that probably means the...
Read more >The contents field on a column layout may only contain ...
I've go the following pinkbox message when trying to access to a related action. Expression evaluation error in rule '*InsertRuleNameHere*' at function a!...
Read more >Arrays (C++) | Microsoft Learn
Learn how to declare and use the native array type in the standard C++ programming language.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hey gmsa, I found out what the issue was. My data function was returning wrong. I needed to do this…
Thanks very much though for your fast response!
@TomFranssen When you create a new regular Vue instance using
new Vue(...)then thedataproperty needs to be an object. Otherwise, when the Vue instance is aVue Component, thendatashould be a function.