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
cd839dc6
authored
2020-05-28 16:24:37 +0800
by
sunnie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
docs
1 parent
5860dfb8
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
12 additions
and
16 deletions
.gitignore
public/favicon.ico
src/api/user.js
src/components/TabBar.vue
src/config/env.development.js
src/main.js
src/plugins/vant.js
src/router/index.js
src/store/modules/app.js
src/utils/request.js
.gitignore
View file @
cd839dc
.DS_Store
node_modules
/dist
/docs
# local env files
.env.local
.env.*.local
...
...
public/favicon.ico
View file @
cd839dc
No preview for this file type
src/api/user.js
View file @
cd839dc
import
qs
from
'qs'
// axios
import
request
from
'@/utils/request'
//user api
//
user api
// 登录
export
function
login
(
params
)
{
...
...
src/components/TabBar.vue
View file @
cd839dc
...
...
@@ -7,16 +7,14 @@
<van-tabbar-item
to=
"/about"
icon=
"user-o"
>
关于我
</van-tabbar-item>
</van-tabbar>
<!--
<van-tabbar
fixed
v-model=
"active"
@
change=
"onChange"
>
</van-tabbar>
<!--
<van-tabbar
fixed
v-model=
"active"
@
change=
"onChange"
>
<van-tabbar-item
to=
"/home"
icon=
"home-o"
>
首页
</van-tabbar-item>
<van-tabbar-item
to=
"/about"
icon=
"user-o"
>
关于我
</van-tabbar-item>
</van-tabbar>
-->
</div>
</
template
>
<
script
>
export
default
{
name
:
'TabBar'
,
data
()
{
...
...
@@ -24,9 +22,7 @@ export default {
active
:
0
}
},
methods
:
{
}
methods
:
{}
}
</
script
>
...
...
src/config/env.development.js
View file @
cd839dc
...
...
@@ -5,5 +5,5 @@ module.exports = {
baseApi
:
'https://test.xxx.com/api'
,
// 本地api请求地址,注意:如果你使用了代理,请设置成'/'
APPID
:
'xxx'
,
APPSECRET
:
'xxx'
,
$cdn
:
'https://imgs.solui.cn'
$cdn
:
'https://imgs.solui.cn'
}
...
...
src/main.js
View file @
cd839dc
...
...
@@ -11,7 +11,7 @@ import store from './store'
// 引入全局样式
import
'@/assets/css/index.scss'
// 设置 js中可以访问 $cdn
import
{
$cdn
}
from
'@/config'
import
{
$cdn
}
from
'@/config'
Vue
.
prototype
.
$cdn
=
$cdn
// 全局引入按需引入UI库 vant
...
...
src/plugins/vant.js
View file @
cd839dc
// 按需全局引入 vant组件
import
Vue
from
'vue'
import
{
Button
,
List
,
Cell
,
Tabbar
,
TabbarItem
}
from
'vant'
import
{
Button
,
List
,
Cell
,
Tabbar
,
TabbarItem
}
from
'vant'
Vue
.
use
(
Button
)
Vue
.
use
(
Cell
)
Vue
.
use
(
List
)
...
...
src/router/index.js
View file @
cd839dc
...
...
@@ -27,7 +27,7 @@ const createRouter = () =>
new
Router
({
// mode: 'history', // 如果你是 history模式 需要配置vue.config.js publicPath
// base: '/app/',
scrollBehavior
:
()
=>
({
y
:
0
}),
scrollBehavior
:
()
=>
({
y
:
0
}),
routes
:
router
})
...
...
src/store/modules/app.js
View file @
cd839dc
...
...
@@ -8,7 +8,7 @@ const mutations = {
}
const
actions
=
{
// 设置name
setUserName
({
commit
},
name
)
{
setUserName
({
commit
},
name
)
{
commit
(
'SET_USER_NAME'
,
name
)
}
}
...
...
src/utils/request.js
View file @
cd839dc
import
axios
from
'axios'
import
store
from
'@/store'
import
{
Toast
}
from
'vant'
import
{
Toast
}
from
'vant'
// 根据环境不同引入不同api地址
import
{
baseApi
}
from
'@/config'
import
{
baseApi
}
from
'@/config'
// create an axios instance
const
service
=
axios
.
create
({
baseURL
:
baseApi
,
// url = base api url + request url
...
...
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