Reputation: 1902
I just installed the masonry-layout by npm but I'm not able to load it in my component.
import "masonry-layout";
export default {
name: "playerSkillComponent",
props: ['player'],
mounted: function () {
// initialization of masonry
var grid = document.querySelector('.masonry-grid');
var msnry = new Masonry( grid, {
// options...
columnWidth: '.masonry-grid-sizer',
itemSelector: '.masonry-grid-item',
percentPosition: true
});
}
}
this is the error I got:
[Vue warn]: Error in mounted hook: "ReferenceError: Masonry is not defined"
Upvotes: 0
Views: 640
Reputation: 1902
Just update the first line (there was a type):
import Masonry from "masonry-layout";
Upvotes: 1