What is the meaning of mixed mapGetters syntax?
P粉492959599
2023-09-02 16:25:06
<p>I saw in the documentation that <code>mapGetters</code> can use objects (for explicit local naming) or arrays (for implicit naming) when mapping stored values to local component state ). However, the code base I'm working with uses an unfamiliar syntax where strings are mixed with arrays. </p>
<pre class="brush:php;toolbar:false;">computed() {
...mapGetters('User', ['userToken'])
}</pre>
<p>What does this syntax mean? </p>
Your link is not a document, just an example. Please refer to the actual documentation
So in your code,
User
is the namespace.