Commit 8a31f95c authored by 吴冠's avatar 吴冠

search

parent ba4e057e
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="flex-between content bg"> <div class="flex-between content bg">
<div class="flex-item"> <div class="flex-item">
<div class="flex-item"> <div class="flex-item">
<img src="~/assets/head/home-fill.png" class="home-fill" alt="logo"></img> <img src="~/assets/head/home-fill.png" class="home-fill" alt="logo"/>
<nuxt-link to="/" class="head-title t1">首页</nuxt-link> <nuxt-link to="/" class="head-title t1">首页</nuxt-link>
</div> </div>
<div class="welcome t1"> <div class="welcome t1">
...@@ -33,12 +33,10 @@ ...@@ -33,12 +33,10 @@
import {getSecond} from '@/common/list.js' import {getSecond} from '@/common/list.js'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
export default { export default {
created(){
},
mounted(){ mounted(){
let tokenStr = Cookies.get("token") let tokenStr = Cookies.get("token")
console.log(1234567890)
console.log(1234567890)
console.log(tokenStr+"-------------") console.log(tokenStr+"-------------")
if(tokenStr){ if(tokenStr){
this.getSecond() this.getSecond()
......
...@@ -24,6 +24,16 @@ ...@@ -24,6 +24,16 @@
<script> <script>
import Cookies from "js-cookie" import Cookies from "js-cookie"
export default { export default {
mounted(){
let _that = this;
document.onkeypress = function(e) {
var keycode = document.all ? event.keyCode : e.which;
if (keycode == 13) {
_that.toSearch();// 登录方法名
return false;
}
};
},
methods:{ methods:{
toSearch(){ toSearch(){
Cookies.set("inputContent",this.input) Cookies.set("inputContent",this.input)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<div class="login-btn"> <div class="login-btn">
<el-button v-on:keyup.13.native="submit" type="primary" @click="submitForm1()" style="width: 100%;">登录</el-button> <el-button type="primary" @click="submitForm1()" style="width: 100%;">登录</el-button>
</div> </div>
</el-form> </el-form>
<!-- 手机验证码验证 --> <!-- 手机验证码验证 -->
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<div v-show="!Verification" class="phonecode"><span>{{timer}}</span>秒后重新获取</div> <div v-show="!Verification" class="phonecode"><span>{{timer}}</span>秒后重新获取</div>
</div> </div>
<div class="login-btn"> <div class="login-btn">
<el-button v-on:keyup.13.native="submit" type="primary" @click="submitForm2()" style="width: 100%;">登录</el-button> <el-button type="primary" @click="submitForm2()" style="width: 100%;">登录</el-button>
</div> </div>
</el-form> </el-form>
<div class="login-font flex-between"> <div class="login-font flex-between">
...@@ -94,20 +94,23 @@ ...@@ -94,20 +94,23 @@
}; };
}, },
mounted(){ mounted(){
var _this = this; let that = this;
document.onkeydown = function(e) { document.onkeypress = function(e) {
let key = window.event.keyCode; var keycode = document.all ? event.keyCode : e.which;
if (key == 13) { if (keycode == 13) {
_this.submitForm1(); that.submitForm1();// 登录方法名
return false;
} }
}; }
var _that = this; let _that = this;
document.onkeydown = function(e) { document.onkeypress = function(e) {
let key = window.event.keyCode; var keycode = document.all ? event.keyCode : e.which;
if (key == 13) { if (keycode == 13) {
_that.submitForm2(); _that.submitForm2();// 登录方法名
return false;
} }
}; };
}, },
methods: { methods: {
handleClick(tab, event) { handleClick(tab, event) {
......
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 to comment