File tree Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Expand file tree Collapse file tree 4 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Vue全家桶+Socket.io+Express/Koa2打造的网页版手机QQ(web app),高仿手
4
4
5
5
## 预览
6
6
7
- 在线预览地址:http ://lenshen.com:8080/ (为了体验到最佳的效果,提供了3个测试账号,需要账号才能登陆哦,具体账号和密码下面有讲)
7
+ 在线预览地址:https ://qq. lenshen.com(为了体验到最佳的效果,提供了3个测试账号,需要账号才能登陆哦,具体账号和密码下面有讲)
8
8
9
9
## 技术栈
10
10
* ** Vue2.0** :实现前端页面构建
@@ -24,6 +24,7 @@ Vue全家桶+Socket.io+Express/Koa2打造的网页版手机QQ(web app),高仿手
24
24
* ** MySQL** :MySQL关系型数据库持久化数据(考虑到表与表之间关系复杂,需要多表查询,最复杂的时候是六张表联查,用MySQL会比Mongodb好得多)
25
25
* ** jsonp** :跨域请求数据
26
26
* ** pm2** :服务端使用pm2部署,常驻进程,比forever好用得多(https://github.com/Unitech/pm2)
27
+ * ** nginx** :服务端使用nginx代理端口转发
27
28
28
29
## 使用方式
29
30
@@ -77,7 +78,7 @@ require("babel-core/register")({
77
78
require (" babel-polyfill" )
78
79
```
79
80
80
- 上面的代码不可以使用import来导入 ,必须使用require,同时需要通过npm安装babel-core、babel-preset-es2015、babel-preset-stage-0、babel-polyfill等依赖。这样就可以愉快地使用import/export了。
81
+ 上面的模块不可以使用import来导入 ,必须使用require,同时需要通过npm安装babel-core、babel-preset-es2015、babel-preset-stage-0、babel-polyfill等依赖。这样就可以愉快地使用import/export了。
81
82
82
83
服务端代码片段如下:
83
84
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export default {
66
66
// 滚动结束时记录滚动位置到store里
67
67
this .savePosition ()
68
68
},
69
- scrollToPosition (time = 0 ){
69
+ scrollToPosition (time = 300 ){
70
70
if (this .scroll ){
71
71
// 如果要滚动到底部
72
72
if (this .isScrollToBottom ){
Original file line number Diff line number Diff line change 8
8
</div >
9
9
<div class =" form" >
10
10
<input type =" text" v-model =" userinfo.user" class =" text"
11
- placeholder =" QQ号/手机号/邮箱" ><br />
11
+ placeholder =" QQ号/手机号/邮箱" ref = " user " ><br />
12
12
<input type =" password" v-model =" userinfo.pwd" class =" text"
13
13
placeholder =" 密码" ><br />
14
14
<input type =" button" @click =" login" class =" btn" value =" 登录" >
@@ -44,6 +44,9 @@ export default {
44
44
// 如果已经登陆了,则进入消息页面
45
45
this .isLogin && this .$router .push (' /message' )
46
46
},
47
+ mounted (){
48
+ this .$refs .user .focus ()
49
+ },
47
50
methods: {
48
51
validate ({user,pwd}){
49
52
if (user== ' ' ){
Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ Vue.use(Vuex)
19
19
20
20
// vueg 转场动画
21
21
const options = {
22
- forwardAnim : 'fadeInRight'
22
+ forwardAnim : 'fadeInRight' ,
23
+ duration :0.3
23
24
}
24
25
Vue . use ( vueg , router , options )
25
26
You can’t perform that action at this time.
0 commit comments