Incorporating Vue into my project to showcase an intricate hexagonal grid has been quite challenging. Utilizing the Honeycomb library for handling the grid data in memory has proven to be both beneficial and complex. The library introduces a specialized Grid
object that not only stores the essential data but also offers a wide range of manipulation methods, drawing inspiration from the functionalities of a typical Array
.
Initially, I attempted to pass the grid object as a property to my Vue component:
@Component
export default class TileMap extends Vue {
@Prop() private grid!: Grid;
Unfortunately, I encountered an issue where all the methods associated with the Grid
object seemed to get lost within my Vue component.
- Upon creating the
Grid
object, the methods were present in the prototype. - However, when utilizing the
Grid
property within my component, the methods were mysteriously absent from the prototype.
Is this behavior to be expected? Should I steer clear of utilizing properties for objects with extensive properties and methods?