Question 5
Consider the below Vue application with markup file “index.html” and javascript file “app.js”.
index.html:
<div id = "app"> <router-view></router-view></div><script src = "app.js"> </script>app.js:
const First = Vue.component("first", { template: `<div>Hello First Component !!</div>` })
const Second = Vue.component("second", { template: `<div>Hello Second Component !!</div>` })
const router = new VueRouter({ base: '/myapp/', routes: [ { path: "/endpoint1", component: First, }, { path: "/endpoint2", component: Second, }, ] });
const app = new Vue({ el: '#app', router, data: {}, methods: {} });Suppose the application is deployed under a subdirectory named “/myapp/” of a domain named “https://appdev2-may2023.com”, and you want to navigate to a page that renders “Hello Second Component !!”. What should be the correct URL to get the desired output?