1.登录页

weexpack  Login.vue

<!-- 登录页 -->
<template><div class="wrapper">  <div class="login">  <div class="input-wrapper">  <input v-model="userNumber" class="input" type="text" placeholder="账号" autofocus="true" value=""/> <image class="input-img" src="http://cdn-img.easyicon.net/png/11741/1174195.gif"></image>  </div><div class="input-wrapper">  <input v-model="userPassword" class="input" type="password" placeholder="密码" value=""/><image class="input-img" src="http://cdn-img.easyicon.net/png/11741/1174192.gif"></image>  </div>  <div class="input-wrapper">  <div class="input-login" @click="login">  <text class="input-login-text">登录</text>  </div>  </div>  <div class="input-wrapper">  <text class="input-forget" @click="findPassword">找回密码</text>  <text class="input-register" @click="register">立即注册</text>  </div></div></div>
</template>  <script>// 弹窗const modal = weex.requireModule('modal');module.exports = {  data(){  return{userNumber:'',  userPassword:''}},created () {//}, methods:{ /*找回密码*/  findPassword() {modal.toast({'message': '找回密码暂时未开发','duration': 1});},/*注册*/  register() {modal.toast({'message': '注册暂时未开发','duration': 1});},/*处理登录*/  login() {  if(!this.userNumber){modal.toast({'message': '请输入手机号','duration': 1});return;  }else if(!this.userPassword.length){modal.toast({'message': '请输入密码','duration': 1});return;  }// 登录成功modal.toast({'message': '登录成功','duration': 1});}  }  }
</script>  <style scoped>/*整体框架 绝对定位*/.wrapper { position: absolute;  top: 0;  right: 0;  bottom: 0;  left: 0;  }  .login{width: 600px;height: 500px;/*垂直水平居中*/position: absolute;  top: 0;  right: 0;  bottom: 0;  left: 0;margin: auto;  }  .input-wrapper{  width: 600px;margin-bottom: 30px;  }  .input {  font-size: 30px;  height: 80px;  width: 600px;  padding-left: 90px;  padding-top: 15px;  padding-bottom: 15px;  border-width:1px;  border-color: #48c9bf;  border-radius:10px;  outline: none;  }  .input-img{  position: absolute;  top:10px;  left: 15px;  width: 60px;  height: 60px;  }  .input-login{  height: 80px;  width: 600px;  background-color: #48c9bf;  border-radius: 10px;  margin-top: 40px;  }  .input-login-text{  height: 80px;  width: 600px;  text-align: center;  line-height: 80px;  color: white;  font-size: 35px;  }  .input-forget{  position: absolute;  left: 20px;  font-size: 30px;  }  .input-register{  position: absolute;  right: 20px;  font-size: 30px;  }
</style>

注:style上需要添加 scoped,否则无法自动适配。

vue  Login.vue

<!-- 登录页 -->
<template><div class="login"><!-- 输入框 --><div class="input-wrapper"><input v-model="userNumber" class="input" type="text" placeholder="账号" autofocus="true" value=""/><img class="input-img" src="https://img-blog.csdnimg.cn/2022010705475952546.gif" /></div><div class="input-wrapper"><input v-model="userPassword" class="input" type="password" placeholder="密码" value=""/><img class="input-img" src="https://img-blog.csdnimg.cn/2022010705475965536.gif" /></div><!-- 登录按钮 --><div class="input-wrapper"><div class="input-login" @click="login">登录</div></div><!-- 其他操作 --><div class="input-wrapper"><span class="input-forget" @click="findPassword">找回密码</span><span class="input-register" @click="register">立即注册</span></div></div>
</template><script>export default {name:'Login',data(){return{userNumber:'',userPassword:''}},mounted () {// 隐藏tab栏this.$store.dispatch('hideTabBar');},methods:{/*找回密码*/findPassword() {this.$toast.center('找回密码暂时未开发');},/*注册*/register() {this.$toast.center('注册暂时未开发');},/*处理登录*/login() {if(!this.userNumber){this.$toast.center('请输入手机号');return;}else if(!this.userPassword){this.$toast.center('请输入密码');return;}/*登录成功*/this.$toast.center('登录成功!');// 跳转homethis.$router.push({path:'/'});}}}
</script><style scoped>.login{width: 100%;height: 200px;position: absolute;top: 0;right: 0;bottom: 0;left: 0;margin: auto;}.input-wrapper{width: 90%;margin: 0px auto 30px;position: relative;}.input {font-size: 16px;height: 44px;width: 100%;border-width:1px;border-style: solid;border-color: #48c9bf;border-radius:5px;outline: none;text-indent:2.5em;}.input-img{position: absolute;top:6px;left: 5px;width: 30px;height: 30px;}.input-login{height: 44px;line-height: 44px;width: 100%;background-color: #48c9bf;border-radius: 6px;color: white;font-size: 16px;text-align: center;}.input-forget{position: absolute;left: 0px;font-size: 16px;}.input-register{position: absolute;right: 0px;font-size: 16px;}
</style>

  

2.效果图

weexpack 的 Login.vue 及 vue 的 Login.vue相关推荐

  1. Vue教程3【使用Vue脚手架】render ref props minin scoped $emit $bus 消息订阅发布 动画

    npm全局安装 切换淘宝npm镜像 npm config set registry https://registry.npm.taobao.org全局安装 npm install -g @vue/cl ...

  2. js文件里获取路由 vue_「如何优雅的使用Vue?」不可不知的Vue实战技巧

    作者: CHICAGO 转发连接:https://juejin.im/post/5e475829f265da57444ab10f 前言 在大家都会用vue的时代,我们又如何去区别是新手小白还是资深vu ...

  3. vue导入html登陆页,Vue 实现 登陆后打开主页面(登陆组件 + 主页面组件)

    本次演示,项目所需 iview,router 首先 在 views 目录 新建 两个 组件 ( login.vue ,index.vue ) login.vue 登录 登 录 export defau ...

  4. Vue.js 第1章 Vue常用指令学习

    今日目标 能够写出第一个vue应用程序 能够接受为什么需要学vue 能够使用指令 能够通过指定完成简单的业务(增加删除查询) 能够理解mvvm 为什么要学习vue 企业需要 可以提高开发效率 实现vu ...

  5. springboot+vue全栈开发_springboot+vue(一)___开发环境以及前后端项目搭建

    nodejs安装 安装: nodejs官网地址:https://nodejs.org/en/ 安装node.js,安装路径我默认安装在C盘  ,可以改变路径 安装配置全局安装路径和缓存 现在配置全局模 ...

  6. 搭建一个vue小页面(入门vue)

    最近在学习vue框架,找了很久在网上找到下面这篇博客,觉得写得通俗易懂,就是其中有些代码尝试了有一点点的小问题,我猜可能版本不同的问题,造成不同的结果,但框架的思想我是觉得写得很通俗易懂的,供大家共享 ...

  7. vue 路由重定向_使用Vue和Vue路由器进行高级路由:重定向和Nav Guard

    vue 路由重定向 While the basics of routing in Vue.js have already been covered, today we'll explore some ...

  8. Vue开发入门(二) | 说说Vue全家桶有哪些~

    全家桶,顾名思义,就是一个系列,可以组合开发成完整强大的Vue项目 前言: *Vue两大核心思想:组件化和数据驱动. 组件化:把整体拆分为各个可以复用的个体 数据驱动:通过数据变化直接影响bom展示, ...

  9. Vue学习记录8,vue脚手架配置代理的两种方式,Github搜索案例,vue-resource,三种插槽,Vuex及搭建Vuex环境,getter和四个map方法的使用, 模块化+命名空间

    目录 vue脚手架配置代理 方法一 方法二 Github搜索案例 UserList.vue UserSearch.vue 效果图 vue-resource 插槽 默认插槽 具名插槽 作用域插槽 Vue ...

  10. vue java实现登录_SpringBoot+Vue+Redis实现单点登录(一处登录另一处退出登录)

    一.需求 实现用户在浏览器登录后,跳转到其他页面,当用户在其它地方又登录时,前面用户登录的页面退出登录(列如qq挤号那种方式) 二.实现思路 用户在前端填写用户信息登录后,后台接收数据先去数据库进行判 ...

最新文章

  1. 如何判断一个网站是否被百度处罚中
  2. qt开发环境 - c++之结构,联合,枚举
  3. leetcode115. 不同的子序列
  4. 盖茨比乔布斯_如何使用盖茨比创建您的博客并通过手机进行处理
  5. 怎样管理计算机制动开关时间,3分钟让你明白按钮启动如何工作的。
  6. premnmx tramnmx postmnmx 函数用法
  7. ExecuteNonQuery(),ExecuteScalar(),ExecuteReader的相关用法
  8. Xgboost中特征重要性计算方法详解
  9. 单门课程成绩管理系统用c语言,[转载]C语言课程设计——学生成绩管理系统
  10. Ubuntu 19.04 缺少libpng12.so.0
  11. 计算机绘图cad期末考试试题,20年广东理工学院成人高考期末考试 计算机绘图(AutoCAD) 复习资料.pdf...
  12. SPSS作业-如何判别是否服从正态分布
  13. STATA画图命令(一)
  14. oracle导数时不包含某个表,EXPDP导数报ORA-00942案例
  15. Arduino-ESP8266 控制舵机开门
  16. 深入理解Android相机体系结构之八
  17. SQL之substrate()函数用法
  18. 数字图像处理之matlab实验(一):基本操作
  19. python 3.X 没有cPickle
  20. 解决su – 后显示-bash-4.1#

热门文章

  1. LCA(包含RMQ)
  2. 欧文6 oracle aqua 测评,欧文6实战测评!详细说说
  3. Why c++ coroutine?Why libgo?
  4. E. AC Challenge ACM-ICPC 2018 南京赛区网络预赛 状压dp + 枚举状态
  5. (转载)【笨木头Lua专栏】基础补充07:协同程序初探
  6. 计算机桌面上的公文包怎么加密,电脑中的公文包怎么用(快速创建公文包的技巧)...
  7. bzoj2733 [HNOI2012]永无乡
  8. CPU资源消耗原因和解决方案:
  9. 二,八,十六进制数转换为十进制数
  10. 强化学习中的递归神经网络