Question 6
Consider the below Vue application with markup file “index.html” and javascript file “app.js”.
index.html:
<div id = "app"> <router-link to="/endpoint1">Home</router-link> <router-view></router-view></div><script src = "app.js"> </script>app.js:
const First = Vue.component("first", { template: `<div>Hello First Component !!</div>`, mounted() { this.$router.push("/endpoint2"); } })
const Second = Vue.component("second", { template: `<div>Hello Second Component !!</div>` })
const router = new VueRouter({ routes: [ { path: "/endpoint1", component: First, }, { path: "/endpoint2", component: Second, }, ] });
const app = new Vue({ el: '#app', router, data: {}, methods: {} });Suppose you open the “index.html” file in a browser, and click on the link with the text “Home”. What will be rendered by the browser except the router links in the navigation menu?
Hello First Component !!
Hello Second Component !!
404
Blank Page