fetch("index.json").then(res=>{
return res.json();
}).then(res=>{
console.log(res)
})
fetch("index.json",{
method:‘post‘,
headers:{
"Content-Type":"application/x-www-form-urlencoded"
},
body:"name=kewin&id=112"
}).then(res=>{
return res.json();
}).then(res=>{
console.log(res);
this.datalist = res.data.films;
})
fetch("index.json",{
method:‘post‘,
headers:{
"Content-Type":"application/json"
},
body:JSON.stringify{
"name":"kewin",
"age":11
}
}).then(res=>{
return res.json();
}).then(res=>{
console.log(res);
this.datalist = res.data.films;
})
fetch("index.json",{
method:‘post‘,
headers:{
"Content-Type":"application/json"
},
body:JSON.stringify{
"name":"kewin",
"age":11
},
credentials:"include"
axios.get("index.json").then(res=>{
console.log(res);
this.datalist = res.data.data.films
})
axios.get("index.json",{
myname:‘kawin‘,
myage:11
}).then(res=>{
console.log(res);
this.datalist = res.data.data.films
})
var obj = { methods:{ methodsA(){ console.log(‘methodsA‘); } } } mixins:[obj],
module.exports = { devServer: { proxy: { ‘/ajax‘: { target: ‘http://m.maoyan.com/‘, // ws: true,代表websocket changeOrigin: true } } } }
module.exports = { pages: { index: { // page 的入口 entry: ‘src/index/main.js‘, // 模板来源 template: ‘public/index.html‘, // 在 dist/index.html 的输出 filename: ‘index.html‘, // 当使用 title 选项时, // template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title> title: ‘Index Page‘, // 在这个页面中包含的块,默认情况下会包含 // 提取出来的通用 chunk 和 vendor chunk。 chunks: [‘chunk-vendors‘, ‘chunk-common‘, ‘index‘] }, // 当使用只有入口的字符串格式时, // 模板会被推导为 `public/subpage.html` // 并且如果找不到的话,就回退到 `public/index.html`。 // 输出文件名会被推导为 `subpage.html`。 subpage: ‘src/subpage/main.js‘ } }
import ElementUI from ‘element-ui‘
import ‘element-ui/lib/theme-chalk/index.css‘
import MintUI from ‘mint-ui‘ import ‘mint-ui/lib/style.css‘ Vue.use(ElementUI)
<script>
var ratio = window.devicePixelRatio;
var meta = document.querySelector(‘[name=viewport]‘);
meta.setAttribute(‘content‘,`width=device-width,initial-scale=${1/ratio},user-scalable=no`)
document.documentElement.style.fontSize = window.innerWidth / 750 * 100 + ‘px‘
</script>
if (‘addEventListener‘ in document) { document.addEventListener(‘DOMContentLoaded‘, function() { FastClick.attach(document.body); }, false); }
import FastClick from ‘fastclick‘
fastclick.attach(document.body)
原文:https://www.cnblogs.com/solaris-wwf/p/12121788.html