Looking to develop a Vue.js component that accepts properties from its parent component, like this example:
<table-cell :value="foo" format="date" />
Although value
and format
are set as properties, Vue automatically sets up observers for their values. However, in my specific case, I am certain that these values will not change, so there is no need for observation.
Considering that my table cell component could be part of a table with 1,000 rows and 10 columns, having these 2 properties observed would result in 20,000 unnecessary observers. I aim to avoid this overhead (especially since my actual table cell component has more intricate properties).
Is it possible to disable the observation of a component property to prevent excessive CPU and memory usage?
Update: I have discovered a potential solution using the functional component approach, detailed here: https://v2.vuejs.org/v2/guide/render-function.html#Functional-Components
I have tested this method on this JSFiddle: https://jsfiddle.net/50wL7mdz/12143/
I am curious if this is the correct strategy...