单纯想要使用js导入axios结果axios一直是未定义
那位遇到过的给点意见,多谢多谢了
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<button onclick="Inter()"> 点击请求</button>
<script>
function Inter() {
axios.get('http://192.168.1.111:8820/dict/gender')
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
}
</script>
</body>
</html>
我这么写完全可以