html 안에 script 태그로 함수 선언하고 그 함수 안에 axios.post 하려고했는데
axios에는 자꾸 Unresolved variable or type axios 라고 뜨고 post에는 Unresolved function or method post() 라고 뜨는데 왜 이럼?
import axios 하면 axios 오류는 사라지긴한데 post는 여전히 저지랄임 에휴 시발
<script>
function accept(name){
console.log(name);
const data = {
name : name
};
axios.post('/point',
{
data : name
}).then(res=>{
console.log(res.data);
}).catch(error=>{
console.log('Error : ', error);
})
이렇게함
코드 올려봐
올렸어
엑시오스 라이브러리 설치했냐?
js폴더에서 따로하면 되는데 왜 html에서는 저렇게 되지;;
import axios가 어딨는데 - dc App
그게 문제가 아님; import 해도 post도 메소드 없다고뜸..