I am looking to extract JSON data using the Axios library. By utilizing my {{ id }}
, I aim to target a specific parameter in the request.
Furthermore, I have an external script file for this purpose.
const Home = {
template: `
<div class="user">
<h2>user {{ id }}</h2>
bet
</div>
`,
props: {
id: {
type: String,
default: 'N/A'
}
}
}
Key CDNs that are included:
<script src="<https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js>"></script>
<script src="<https://unpkg.com/vue-router/dist/vue-router.js>"></script>
<script src="<../../jobs/job.js>"></script>
The routing structure is relatively straightforward:
const router = new VueRouter({
mode: 'history',
routes: [
{
path: '/jobs/:id?',
component: Home,
props: true
},
],
})
Many thanks!