Use Axios directly
parent
a2e1595b89
commit
d15845a793
|
@ -10,6 +10,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@nuxtjs/axios": "^5.12.2",
|
||||
"axios": "^0.21.1",
|
||||
"body-parser": "^1.19.0",
|
||||
"bootstrap": "^4.5.2",
|
||||
"bootstrap-vue": "^2.17.3",
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -409,16 +410,16 @@ export default {
|
|||
},
|
||||
watch: {
|
||||
async sourceText(newValue) {
|
||||
this.targetText = await this.$axios.$post("/api/get", {
|
||||
this.targetText = (await axios.post("/api/get", {
|
||||
sourceText: newValue,
|
||||
selectedLanguage: this.selectedLanguage
|
||||
})
|
||||
})).data
|
||||
},
|
||||
async selectedLanguage(newValue) {
|
||||
this.targetText = await this.$axios.$post("/api/get", {
|
||||
this.targetText = (await axios.post("/api/get", {
|
||||
sourceText: this.sourceText,
|
||||
selectedLanguage: newValue
|
||||
})
|
||||
})).data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue