Im using a v-slot
in a <b-table>
so I can create a link.
The first part of the link contains data from the datasource. However the querystring has a parameter that I need to include in the link. How can I get scope to my data that holds the querystring value so I can add the querystring to the link in my v-slot
?
Thank you in advance,
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();
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…