Commit 671c0e3d by 肖康

x

parent ad89a207
......@@ -3106,6 +3106,7 @@
"version": "1.0.2",
"resolved": "https://registry.nlark.com/call-bind/download/call-bind-1.0.2.tgz",
"integrity": "sha1-sdTonmiBGcPJqQOtMKuy9qkZvjw=",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
......@@ -5790,7 +5791,8 @@
"function-bind": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz",
"integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0="
"integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=",
"dev": true
},
"functional-red-black-tree": {
"version": "1.0.1",
......@@ -5814,6 +5816,7 @@
"version": "1.1.1",
"resolved": "https://registry.nlark.com/get-intrinsic/download/get-intrinsic-1.1.1.tgz",
"integrity": "sha1-FfWfN2+FXERpY5SPDSTNNje0q8Y=",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
......@@ -5943,6 +5946,7 @@
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/has/download/has-1.0.3.tgz",
"integrity": "sha1-ci18v8H2qoJB8W3YFOAR4fQeh5Y=",
"dev": true,
"requires": {
"function-bind": "^1.1.1"
}
......@@ -5962,7 +5966,8 @@
"has-symbols": {
"version": "1.0.2",
"resolved": "https://registry.nlark.com/has-symbols/download/has-symbols-1.0.2.tgz",
"integrity": "sha1-Fl0wcMADCXUqEjakeTMeOsVvFCM="
"integrity": "sha1-Fl0wcMADCXUqEjakeTMeOsVvFCM=",
"dev": true
},
"has-value": {
"version": "1.0.0",
......@@ -8076,7 +8081,8 @@
"object-inspect": {
"version": "1.10.2",
"resolved": "https://registry.nlark.com/object-inspect/download/object-inspect-1.10.2.tgz",
"integrity": "sha1-tjhaPit8rgter8+Qzd+F0Sh2fzA="
"integrity": "sha1-tjhaPit8rgter8+Qzd+F0Sh2fzA=",
"dev": true
},
"object-is": {
"version": "1.1.5",
......@@ -9320,6 +9326,7 @@
"version": "6.10.1",
"resolved": "https://registry.nlark.com/qs/download/qs-6.10.1.tgz",
"integrity": "sha1-STFIL6jWR6Wqt5nFJx0hM7mB+2o=",
"dev": true,
"requires": {
"side-channel": "^1.0.4"
}
......@@ -10004,6 +10011,7 @@
"version": "1.0.4",
"resolved": "https://registry.nlark.com/side-channel/download/side-channel-1.0.4.tgz",
"integrity": "sha1-785cj9wQTudRslxY1CkAEfpeos8=",
"dev": true,
"requires": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
......
......@@ -6,13 +6,11 @@
"dev": "vue-cli-service serve",
"build-test": "vue-cli-service build --mode test",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"element-ui": "^2.15.1",
"qs": "^6.10.1",
"vue": "^2.6.11",
"vue-router": "^3.2.0"
},
......@@ -30,6 +28,7 @@
"less": "^3.0.4",
"less-loader": "^5.0.0",
"prettier": "^2.2.1",
"qs": "^6.10.1",
"vue-template-compiler": "^2.6.11"
},
"eslintConfig": {
......
import axios from 'axios';
import qs from 'qs';
/**
* 封装axios的通用请求
* @param {string} method get\post\put\delete
* @param {string} url 请求的接口URL
* @param {object} param 传的参数,没有则传空对象
*/
const envs = process.env.NODE_ENV;
let NODE_ENVS="/";
switch (envs) {
case 'development':
//开发环境
NODE_ENVS = 'https://api.apiopen.top';
break;
case 'test':
//测试环境
NODE_ENVS = '';
break;
case 'production':
//线上环境
NODE_ENVS = '/';
break;
}
export const http = (method, url, param) => {
param = param && typeof param === 'object' ? param : {};
const config = {
url: `${NODE_ENVS}${url}`,
method: method,
transformRequest: [function (param) {
return qs.stringify(param);
}],
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
};
// post请求时需要设定Content-Type
if (method === 'post') {
config.headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
config.data = param;
} else if (method === 'get') {
config.params = param;
}
return axios(config);
}
body{
background: #ccc;
body,
dl,
dt,
dd,
ul,
ol,
li,
pre,
form,
input,
p,
th,
td {
font-weight: 400;
margin : 0;
padding : 0;
}
h1,
h2,
h3,
h4,
h4,
h5 {
margin : 0;
padding: 0;
}
body {
background-color: #FFFFFF;
color : #333;
font-family : "微软雅黑";
font-size : 12px;
text-align : left;
}
select {
font-size: 12px;
}
table {
border-collapse: collapse;
}
img {
border: 0 none;
}
em,
strong,
th,
i {
font-style : normal;
font-weight: 400;
}
ol,
ul {
list-style-image : none;
list-style-position: outside;
list-style-type : none;
}
caption,
th {
text-align: left;
}
\ No newline at end of file
body{background:#ccc}
\ No newline at end of file
body,dl,dt,dd,ul,ol,li,pre,form,input,p,th,td{font-weight:400;margin:0;padding:0}h1,h2,h3,h4,h4,h5{margin:0;padding:0}body{background-color:#FFFFFF;color:#333;font-family:"微软雅黑";font-size:12px;text-align:left}select{font-size:12px}table{border-collapse:collapse}img{border:0 none}em,strong,th,i{font-style:normal;font-weight:400}ol,ul{list-style-image:none;list-style-position:outside;list-style-type:none}caption,th{text-align:left}
\ No newline at end of file
<template>
<div class="meau-yx">
<div class="meau-con">
我是左侧菜单
</div>
</div>
</template>
<script>
export default {
name: 'menus',
props: {
},
data() {
return {
}
},
methods: {
}
}
</script>
<style lang="less">
#app{padding-left:220px;}
.meau-yx{
width:220px;
background: #ccc;
position:fixed;
left:0px;
top:0px;
bottom:0px;
.meau-con{
width:100%;
}
}
</style>
\ No newline at end of file
......@@ -3,6 +3,7 @@ import App from "./App.vue";
import router from "./router";
import filters from './filters'
import directive from './directive'
import {http} from './ajax/index.js';
//本地环境开启提示信息
......@@ -10,12 +11,16 @@ Vue.config.productionTip = false;
//加载全局样式
import '@/assets/css/public/common.min.css'
//过滤器遍历
//加载过滤器
Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
//自定义指令
//加载自定义指令
Vue.use(directive);
//挂载到VUE原型上封装后的http请求
Vue.prototype.$http = http;
new Vue({
router,
......
<template>
<div>我是首页</div>
</template>
\ No newline at end of file
<div class="index">
我是首页
<el-button @click="ceshi">element测试按钮</el-button>
<Menu />
</div>
</template>
<script>
import Vue from 'vue';
import Menu from "@/components/menu.vue";
import Tool from '../../tool'
import {
Button
} from 'element-ui'
Vue.use(Button)
export default {
name: "index",
data() {
return {
};
},
watch: {},
created() {
},
computed: {
},
methods: {
ceshi() {
this.$http('get', "/getJoke", {
page:1,count:2,type:'video'
})
.then(res => {
console.log(res)
})
.catch(err => {
console.log(err.message);
})
}
},
components: {
Menu
}
};
</script>
<style scoped>
@import "../../assets/css/index/index.min.css";
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment