|
|
|
@ -1,10 +1,11 @@
|
|
|
|
<script lang="ts">
|
|
|
|
<script lang="ts">
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
|
|
|
|
props: ['currentWorkingCategoryID'],
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
categories:[],
|
|
|
|
categories:[],
|
|
|
|
categorySessions:[]
|
|
|
|
categorySessions:[],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
@ -18,16 +19,25 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
this.practice_category_id = this.currentWorkingCategoryID
|
|
|
|
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'categories').then((response)=>{
|
|
|
|
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'categories').then((response)=>{
|
|
|
|
this.categories = response.data
|
|
|
|
this.categories = response.data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
|
|
currentWorkingCategoryID(newValue){
|
|
|
|
|
|
|
|
axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'show-category/'+newValue).then((response)=>{
|
|
|
|
|
|
|
|
this.categorySessions = response.data;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
this.practice_category_id = newValue
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<h2>Show Category</h2>
|
|
|
|
<h2>Show Category</h2>
|
|
|
|
<select @change="change">
|
|
|
|
<select @change="change" v-model="practice_category_id">
|
|
|
|
<option v-for="category in categories" v-bind:value="category.id">
|
|
|
|
<option v-for="category in categories" v-bind:value="category.id">
|
|
|
|
{{category.id}}.
|
|
|
|
{{category.id}}.
|
|
|
|
{{category.instrument}}
|
|
|
|
{{category.instrument}}
|
|
|
|
|