Код: Выделить всё
import { ref } from 'vue';
import axios from 'axios';
const nickname = ref('');
function checkNickname() {
if (nickname.value.length === 0) {
return true;
}
return axios.post('localhost:8080/api/v1/public/account/nickname', nickname.value.toString().trim(), {
headers: {
'content-type': 'text/plain',
}
})
.then(response => !Boolean(response.data), () => true);
}
Nickname taken!
Подробнее здесь: https://stackoverflow.com/questions/798 ... -vue-axios
Мобильная версия