You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cjvt-valency/src/frontend_vue/src/components/LFunctors.vue

55 lines
1.3 KiB

<template>
<div class="redlinks">
<table>
<tr v-for="functor in functors">
<td><a href="#" v-on:click="selectFunctor(functor)">{{ functor[0] }}</a></td>
<td>({{ functor[1] }})</td>
</tr>
</table>
</div>
</template>
<script>
export default {
name: "LWords",
props: ["appState"],
data() {return {
functors: []
}},
methods: {
apiGetFunctors: function () {
var component = this
this.$http.get(
this.$root.store.api_addr +
"/api/functors/" +
this.$root.store.selCorpus
)
.then(function(response) {
component.$root.store.api_error = null
component.functors = response.data
})
.catch(function(error) {
component.$root.store.api_error = error
})
},
selectFunctor: function (functor) {
this.$router.push({
name: "MainDispl",
params: {
hw: functor[0],
fmode: true
}
})
}
},
mounted: function() {
this.apiGetFunctors()
}
}
</script>
<style>
table {
width: 100%;
}
</style>