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

search

parent ba4e057e
......@@ -4,7 +4,7 @@
<div class="flex-between content bg">
<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>
</div>
<div class="welcome t1">
......@@ -33,12 +33,10 @@
import {getSecond} from '@/common/list.js'
import Cookies from 'js-cookie'
export default {
created(){
},
mounted(){
let tokenStr = Cookies.get("token")
console.log(1234567890)
console.log(1234567890)
console.log(tokenStr+"-------------")
if(tokenStr){
this.getSecond()
......
......@@ -24,6 +24,16 @@
<script>
import Cookies from "js-cookie"
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:{
toSearch(){
Cookies.set("inputContent",this.input)
......
......@@ -19,7 +19,7 @@
</el-input>
</el-form-item>
<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>
</el-form>
<!-- 手机验证码验证 -->
......@@ -35,7 +35,7 @@
<div v-show="!Verification" class="phonecode"><span>{{timer}}</span>秒后重新获取</div>
</div>
<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>
</el-form>
<div class="login-font flex-between">
......@@ -94,20 +94,23 @@
};
},
mounted(){
var _this = this;
document.onkeydown = function(e) {
let key = window.event.keyCode;
if (key == 13) {
_this.submitForm1();
let that = this;
document.onkeypress = function(e) {
var keycode = document.all ? event.keyCode : e.which;
if (keycode == 13) {
that.submitForm1();// 登录方法名
return false;
}
};
var _that = this;
document.onkeydown = function(e) {
let key = window.event.keyCode;
if (key == 13) {
_that.submitForm2();
}
let _that = this;
document.onkeypress = function(e) {
var keycode = document.all ? event.keyCode : e.which;
if (keycode == 13) {
_that.submitForm2();// 登录方法名
return false;
}
};
},
methods: {
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