As introduced before, the contents of data are expected to be view related. In this article we give a list of inproppriate uses of the data.
Functions
Functions are not suitable to be stored in the data. Functions are expected to be separated from the data, and can be imported from other source files or implemented as component methods.
1 | // bad |
DOM Objects
1 | // bad |
Complex Objects
Complex objects like components are not suitable to be stored in the data.
For example, using data to store dynamic child components is not recommended, use member properties instead.
1 | // bad |