Just like another response mentioned, in JavaScript plain objects function as associative arrays:
...
links : {'My Dashboard': '/dashboard', 'My Account': '/account'},
...
Keys can be any string. If a key includes spaces or other special characters, you can access it using bracket notation. This is supported in Vue templates because it's a basic JS feature:
{{links['My Dashboard']}}
The issue with plain objects is that the order of keys is not guaranteed by specifications, even though it tends to stay consistent across different implementations.
An updated solution that ensures key order is the ES6 Map
. Currently, it's not reactive in Vue and can only replace plain objects for static data:
...
links : new Map([['My Dashboard', '/dashboard'], ['My Account': '/account']]),
...