Ajax
数据交换和异步交互
原生Ajax
var xmlHttpRequest = new Request();
xmlHttpRequest.open('GET','url');
xmlHttpRequest.send();
xmlHttpRequest.onreadystatechange = function(){
if(xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == 200){
//status200代表返回成功
document.getElementById('div1').innerHTML = xmlHttpRequest.responseText;
}
}
比较繁琐
Axios
对Ajax进行了封装
axios.get('url').then((result)=>{
})
前端工程化
node_modules是项目依赖包
public是静态文件
src是源代码
package.json是模块基本信息,项目开发所需模块
vue.config.js保存vue配置文件
assets是静态资源
components是可重用组件
router路由配置
views视图组件
App.vue 入口页面
main.js 入口js文件
Element UI
组件库
Table
Pagintion
Dialog
Nginx
conf是配置文件目录
html是静态资源文件目录
logs日志文件目录
temp临时文件目录