Main.vue:
<router-link :to="{name:'Home'}">首页</router-link>
routing:
The error is reported as follows:
Why does using :to="{name:'Home'}" report an error, but the ordinary to="/home" has no problem?
phpcn_u15822017-06-12 09:34:23
This is embarrassing. Vue should directly parse the data in to as a string, so if the method you wrote cannot parse it, an error will be reported.