I am working with a v-slot
in a <b-table>
to create a link.
The link's initial part consists of data from the source. However, there is a parameter in the querystring that I need to include in the link. How can I access the scope of my data containing the querystring value so that I can add it to the link in my v-slot
?
Thanks for your help, Marty
<template>
<div>
<h1>View Users</h1>
Select a user to edit
<b-table striped :items="users">
<template v-slot:cell(id)="data">
<a :href="'/#/admin/user?userId=' + data.value + '&companyId=' + ##HERE## ">{{ data.value }}</a>
</template>
</b-table>
</div>
</template>
export default {
data() {
return {
users: [],
companyId: ""
}
},
methods: {
getUsers() {
var self = this;
self.$client.get('/api/Admin/GetUsers?companyId=' + this.$route.query.companyId).then(response => {
self._data.users = response.data;
});
}
},
mounted() {
this.companyId = this.$route.query.companyId
this.getUsers();
}
}