48 lines
1.1 KiB
Vue
48 lines
1.1 KiB
Vue
<!-- components/AnotherComponent.vue -->
|
|
<template>
|
|
<v-container>
|
|
<v-row>
|
|
<v-col>
|
|
<h2>{{ $t('anotherComponent.title') }}</h2>
|
|
<v-text-field v-model="param2" :label="$t('anotherComponent.param2Label')"></v-text-field>
|
|
<p>{{ $t('anotherComponent.param2') }}: {{ param2 }}</p>
|
|
<v-btn @click="sendData">{{ $t('anotherComponent.sendDataButton') }}</v-btn>
|
|
<div v-if="data">{{ $t('anotherComponent.response') }}: {{ data }}</div>
|
|
<div v-if="error">{{ $t('anotherComponent.error') }}: {{ error.message }}</div>
|
|
</v-col>
|
|
</v-row>
|
|
</v-container>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
computed: {
|
|
param2: {
|
|
get() {
|
|
return this.$store.state.param2;
|
|
},
|
|
set(value) {
|
|
this.$store.commit('setParam2', value);
|
|
}
|
|
},
|
|
data() {
|
|
return this.$store.state.data;
|
|
},
|
|
error() {
|
|
return this.$store.state.error;
|
|
}
|
|
},
|
|
methods: {
|
|
sendData() {
|
|
this.$store.dispatch('sendData');
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
|
|
<style scoped>
|
|
h2 {
|
|
color: green;
|
|
}
|
|
</style>
|
|
|