"If you click ""count"" and ""about"" on the router-link in App.vue, you will not be able to transition."
Check this link
App.vue
<v-content>
<divid="nav">
<router-link to="/">count</router-link>|
<router-link to="/about">about</router-link>|
<router-view/>
</div>
</v-content>
@@@@@@
<script>
import {mapActions} from "vuex";
import SideNav from "./components/SideNav";
export default {
name: "App",
components: {
SideNav
},
methods: {
...mapActions ("toggleSideMenu")
}
};
</script>
<style scoped>
#nav{
padding —30px;
font-size: 20px;
color:red;
}
#nava{
font-weight:bold;
color:#2c3e50;
}
# nava.router-link-exact-active {
color:#42b983;
}
</style>
router/index.js
import Vue from 'vue'
import Router from 'vue-router'
import About from '../views/About.vue'
import Count from '../views/Count.vue'
Vue.use (Router)
export default new Router({
mode: 'history',
base —process.env.BASE_URL,
routes: [
{
path: '/',
name: 'count',
component:Count
},
{
path: '/about',
name: 'about',
component —About
},
]
})
First
[Vue warn]: Unknown custom element: <router-link>- Did you register the component correctly? For recurring components, make sure to provide the "name" option.
found in
--- > App > at src/App.vue
<Root>
@@@@@@@@
Second
[Vue warn]: Unknown custom element: <router-view>- Did you register the component correctly? For recurring components, make sure to provide the "name" option.
found in
--- > App > at src/App.vue
<Root>
@@@@@@@
As a reference to the error statement, I think I registered the components correctly, but the transition is still not going well.I'm sorry to keep bothering you, but I'd appreciate it if you could give me some advice.
javascript vue.js
The router was not loaded purely into main.js.
src/main.js
import Vue from 'vue'
import App from './App.vue'
import verify from '.'/plugins/veetify';
import store from './store';
import router from './router';
new Vue({
verify,
router,
store,
render —h=>h(App)
}).$mount('#app')
676 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
523 Uncaught (inpromise) Error on Electron: An object could not be cloned
544 PHP ssh2_scp_send fails to send files as intended
541 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.