Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
xqz
/
dianDemo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
c6bd6058
authored
2020-04-20 22:14:10 +0800
by
宋楠
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
h5
1 parent
6c4a6a6f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
43 deletions
src/App.vue
src/api/user.js
src/assets/css/index.scss
src/main.js
src/views/home/about.vue
src/views/home/index.vue
vue.config.js
src/App.vue
View file @
c6bd605
<
template
>
<div
id=
"app"
>
<div
class=
"app"
id=
"app"
>
<keep-alive>
<router-view
v-if=
"$route.meta.keepAlive"
></router-view>
</keep-alive>
...
...
@@ -13,10 +13,9 @@ import TabBar from '@/components/TabBar'
export
default
{
name
:
'App'
,
components
:
{
components
:
{
TabBar
}
,
}
}
</
script
>
<
style
lang=
"scss"
>
</
style
>
\ No newline at end of file
<
style
lang=
"scss"
></
style
>
...
...
src/api/user.js
View file @
c6bd605
...
...
@@ -8,8 +8,8 @@ export function login(params) {
return
request
({
url
:
'/user/login'
,
method
:
'post'
,
data
:
qs
.
stringify
(
params
)
,
// hideloading: true
data
:
qs
.
stringify
(
params
)
// hideloading: true
})
}
// 用户信息
...
...
@@ -17,6 +17,7 @@ export function getUserInfo(params) {
return
request
({
url
:
'/user/userinfo'
,
method
:
'get'
,
data
:
qs
.
stringify
(
params
)
data
:
qs
.
stringify
(
params
),
hideloading
:
true
})
}
...
...
src/assets/css/index.scss
View file @
c6bd605
@import
'./variables.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
{
padding-bottom
:
50px
padding-bottom
:
50px
;
}
\ No newline at end of file
...
...
src/main.js
View file @
c6bd605
...
...
@@ -5,7 +5,7 @@ import App from './App.vue'
import
router
from
'./router'
import
store
from
'./store'
// 引入全局样式
//
import '@/assets/css/index.scss'
import
'@/assets/css/index.scss'
// 全局引入按需引入UI库 vant
import
'@/plugins/vant'
...
...
src/views/home/about.vue
View file @
c6bd605
...
...
@@ -7,10 +7,12 @@
A vue h5 template with Vant UI
</h2>
<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"
>
项目作者: sunnie
</div>
<div
class=
"item"
></div>
<div
class=
"author"
></div>
<div
class=
"wechat"
></div>
<div>
关注公众号:回复“加群”即可加 前端仙女群
</div>
</div>
</div>
</div>
...
...
@@ -18,19 +20,16 @@
<
script
>
// 请求接口
import
{
getUserInfo
}
from
'@/api/user.js'
import
{
getUserInfo
}
from
'@/api/user.js'
export
default
{
data
()
{
return
{
}
return
{}
},
computed
:
{},
mounted
()
{
this
.
initData
()
},
...
...
@@ -38,19 +37,20 @@ export default {
// 请求数据案例
initData
()
{
// 请求接口数据,仅作为展示,需要配置src->config下环境文件
const
params
=
{
user
:
'sunnie'
}
const
params
=
{
user
:
'sunnie'
}
getUserInfo
(
params
)
.
then
(()
=>
{
})
.
catch
(()
=>
{
})
.
then
(()
=>
{})
.
catch
(()
=>
{})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.app-container
{
background
:
#fff
;
height
:
100%
;
.warpper
{
padding
:
12px
;
background
:
$
background-color
;
.demo-home__title
{
margin
:
0
0
6px
;
font-size
:
32px
;
...
...
@@ -75,6 +75,7 @@ export default {
.list
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
color
:
#666
;
font-size
:
14px
;
.item
{
...
...
@@ -84,11 +85,15 @@ export default {
}
.author
{
margin
:
10px
auto
;
width
:
200px
;
height
:
200px
;
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
>
...
...
src/views/home/index.vue
View file @
c6bd605
...
...
@@ -12,19 +12,14 @@
</
template
>
<
script
>
import
TabBar
from
'@/components/TabBar'
// 请求接口
import
{
getUserInfo
}
from
'@/api/user.js'
export
default
{
data
()
{
return
{
list
:
[
'Vue-cli4'
,
'
配置多环境变量'
,
'
VantUI 组件按需加载'
,
'
Sass'
,
'配置多环境变量'
,
'VantUI 组件按需加载'
,
'Sass'
,
'Webpack 4'
,
'Vuex'
,
' Axios 封装及接口管理'
,
...
...
@@ -43,27 +38,16 @@ export default {
computed
:
{},
mounted
()
{
this
.
initData
()
},
mounted
()
{},
methods
:
{
// 请求数据案例
initData
()
{
// 请求接口数据,仅作为展示,需要配置src->config下环境文件
const
params
=
{
user
:
'sunnie'
}
getUserInfo
(
params
)
.
then
(()
=>
{
})
.
catch
(()
=>
{
})
}
}
methods
:
{}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.app-container
{
.warpper
{
padding
:
12px
;
background
:
$
background-color
;
background
:
#fff
;
.demo-home__title
{
margin
:
0
0
6px
;
font-size
:
32px
;
...
...
vue.config.js
View file @
c6bd605
...
...
@@ -72,6 +72,8 @@ module.exports = {
// 详情: https://cli.vuejs.org/guide/css.html#passing-options-to-pre-processor-loaders
prependData
:
`
@import "assets/css/index.scss";
@import "assets/css/mixin.scss";
@import "assets/css/variables.scss";
$cdn: "
${
defaultSettings
.
$cdn
}
";
`
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment