This commit is contained in:
宋楠 2020-04-20 22:14:10 +08:00
parent 6c4a6a6f6a
commit c6bd6058c9
7 changed files with 43 additions and 43 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div id="app"> <div class="app" id="app">
<keep-alive> <keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view> <router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive> </keep-alive>
@ -13,10 +13,9 @@ import TabBar from '@/components/TabBar'
export default { export default {
name: 'App', name: 'App',
components: { components: {
TabBar TabBar
}, }
} }
</script> </script>
<style lang="scss"> <style lang="scss"></style>
</style>

View File

@ -8,8 +8,8 @@ export function login(params) {
return request({ return request({
url: '/user/login', url: '/user/login',
method: 'post', method: 'post',
data: qs.stringify(params), data: qs.stringify(params)
// hideloading: true // hideloading: true
}) })
} }
// 用户信息 // 用户信息
@ -17,6 +17,7 @@ export function getUserInfo(params) {
return request({ return request({
url: '/user/userinfo', url: '/user/userinfo',
method: 'get', method: 'get',
data: qs.stringify(params) data: qs.stringify(params),
hideloading: true
}) })
} }

View File

@ -1,5 +1,14 @@
@import './variables.scss'; @import './variables.scss';
@import './mixin.scss'; @import './mixin.scss';
html,
body
.app {
color: #333333;
font-family: Arial, Helvetica, 'STHeiti STXihei', 'Microsoft YaHei', Tohoma, sans-serif;
background-color: $background-color;
}
.app-container{ .app-container{
padding-bottom:50px padding-bottom:50px;
} }

View File

@ -5,7 +5,7 @@ import App from './App.vue'
import router from './router' import router from './router'
import store from './store' import store from './store'
// 引入全局样式 // 引入全局样式
// import '@/assets/css/index.scss' import '@/assets/css/index.scss'
// 全局引入按需引入UI库 vant // 全局引入按需引入UI库 vant
import '@/plugins/vant' import '@/plugins/vant'

View File

@ -7,10 +7,12 @@
A vue h5 template with Vant UI A vue h5 template with Vant UI
</h2> </h2>
<div class="list"> <div class="list">
<div class="author"></div>
<div class="item">项目地址: <a href="https://github.com/sunniejs">https://github.com/sunniejs</a></div> <div class="item">项目地址: <a href="https://github.com/sunniejs">https://github.com/sunniejs</a></div>
<div class="item">项目作者: sunnie</div> <div class="item">项目作者: sunnie</div>
<div class="item"></div> <div class="item"></div>
<div class="author"></div> <div class="wechat"></div>
<div>关注公众号回复加群即可加 前端仙女群</div>
</div> </div>
</div> </div>
</div> </div>
@ -18,19 +20,16 @@
<script> <script>
// //
import { getUserInfo } from '@/api/user.js' import {getUserInfo} from '@/api/user.js'
export default { export default {
data() { data() {
return { return {}
}
}, },
computed: {}, computed: {},
mounted() { mounted() {
this.initData() this.initData()
}, },
@ -38,19 +37,20 @@ export default {
// //
initData() { initData() {
// src->config // src->config
const params = { user: 'sunnie' } const params = {user: 'sunnie'}
getUserInfo(params) getUserInfo(params)
.then(() => { }) .then(() => {})
.catch(() => { }) .catch(() => {})
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-container { .app-container {
background: #fff;
height: 100%;
.warpper { .warpper {
padding: 12px; padding: 12px;
background: $background-color;
.demo-home__title { .demo-home__title {
margin: 0 0 6px; margin: 0 0 6px;
font-size: 32px; font-size: 32px;
@ -75,6 +75,7 @@ export default {
.list { .list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center;
color: #666; color: #666;
font-size: 14px; font-size: 14px;
.item { .item {
@ -84,11 +85,15 @@ export default {
} }
.author { .author {
margin:10px auto;
width: 200px; width: 200px;
height: 200px; height: 200px;
background: url($cdn+'/weapp/me.png') center / contain no-repeat; background: url($cdn+'/weapp/me.png') center / contain no-repeat;
} }
.wechat {
width: 200px;
height: 200px;
background: url($cdn+'/wx/640.gif') center / contain no-repeat;
}
} }
} }
</style> </style>

View File

@ -12,19 +12,14 @@
</template> </template>
<script> <script>
import TabBar from '@/components/TabBar'
//
import { getUserInfo } from '@/api/user.js'
export default { export default {
data() { data() {
return { return {
list: [ list: [
'Vue-cli4', 'Vue-cli4',
' 配置多环境变量', '配置多环境变量',
' VantUI 组件按需加载', 'VantUI 组件按需加载',
' Sass', 'Sass',
'Webpack 4', 'Webpack 4',
'Vuex', 'Vuex',
' Axios 封装及接口管理', ' Axios 封装及接口管理',
@ -43,27 +38,16 @@ export default {
computed: {}, computed: {},
mounted() { mounted() {},
this.initData()
},
methods: { methods: {}
//
initData() {
// src->config
const params = { user: 'sunnie' }
getUserInfo(params)
.then(() => { })
.catch(() => { })
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.app-container { .app-container {
.warpper { .warpper {
padding: 12px; padding: 12px;
background: $background-color; background: #fff;
.demo-home__title { .demo-home__title {
margin: 0 0 6px; margin: 0 0 6px;
font-size: 32px; font-size: 32px;

View File

@ -72,6 +72,8 @@ module.exports = {
// 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders // 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
prependData: ` prependData: `
@import "assets/css/index.scss"; @import "assets/css/index.scss";
@import "assets/css/mixin.scss";
@import "assets/css/variables.scss";
$cdn: "${defaultSettings.$cdn}"; $cdn: "${defaultSettings.$cdn}";
` `
} }