VueDemo-10.注册用户

10.注册用户

 

10.1 构建注册页面

src/views/register/step1.vue

<template>
  <div class="form">
    <van-field v-model="tel" type="tel" placeholder="请输入手机号" />
    <div class="my-button">
      <van-button color="#ff6666" block round>下一步</van-button>
    </div>
  </div>
</template>
<script>
import Vue from 'vue'
import { Field, Button } from 'vant'
Vue.use(Field)
Vue.use(Button)
export default {
  data () {
    return {
      tel: ''
    }
  }
}
</script>
<style lang="stylus">
.form
  .my-button
    margin-top 30px
</style>
​

src/views/register/step2.vue

<template>
  <div class="form">
    <div class="formTip">
      <van-image :src="img"></van-image>
      <p>我们将以短信的形式发送验证码至您的手机</p>
    </div>
    <van-field
      v-model="telCode"
      center
      clearable
      placeholder="请输入短信验证码"
    >
      <template #button>
        <van-button size="small" >发送验证码</van-button>
      </template>
    </van-field>
    <div class="my-button">
      <van-button color="#ff6666" block round>下一步</van-button>
    </div>
  </div>
</template>
<script>
import Vue from 'vue'
import { Field, Button, Image as VanImage } from 'vant'
Vue.use(Field)
Vue.use(Button)
Vue.use(VanImage)
export default {
  data () {
    return {
      img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAACNCAYAAAAXU/AtAAAAAXNSR0IArs4c6QAAHz5JREFUeAHtXQm4XEWVPnX7rVnYshKIiLLIfCNjYjBBRQFBZRTEMaDAhwwMi6zfJySEQMA3EEG+AZ0BFwREASEa4gyCiBiWMHEkSAzOqIMIDotkgfACJCFv67415z+3zu3b/fot3a9vv9v97vm+ulV16tT21//Oq7u2oYSLtR0e/aD3eKLcieTZOeTRJDK5TvLMWk7fTZ+fsNyYDj/h00iHFxMCJqZ2q9KsvWXJ3mT9FeT5s8lYkuBF4gx3Y+w6ynjzzfHXvVCVTtNG6gqBxBJYyNvnP8led4oQNyArcb6IyIy3ZzczieemJK4r7lVlsF5VWqlyI7Jt6KEVZL0p5PPfmOVh5rgTbBSQLwiim0I5f4XUq/JY0uaSjUAiCUw30PGUM7OFsCAviItY0iC0I7Howvxs+vF23iunMpY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wYJxwLe79uNwC4e6XkCZ1DAPMneec1sms1/7woXfq3fyYtpjygNH15kXD+9xnckeGWT+Joc50fIGTK/1rD2vZeHCUXl7uAHxTNaUmMhHcfgvDo0mmNNRyUI7HU1sCPBiH8phZQOwGHM4NDagEtJw+tzhAAvBi38QF53O4XgOuwxgljQ1fhCPPwxOt/IWqWafOB1NEFICD4E+E7mVTY7m8EUOn+TAv56UKOFPSRJ+FOcODvczcWvyZfSkIJASuIyVYDJPZvPPcDjchellVK+m6SZuDL/BhvBTJm3svwZUzcFXs62UwCNAkwl9AFdXMs/m9Ds4VPvSpM9tvszhtxwe4/AoE7ZunlXg8cYqKYGrCC8Tuo2b25fD/pEwjdMTOUxwMdIIEHzLVMN2l36V42cj4TkmbOSre1ySSojA/wPEnUJCeh9QLwAAAABJRU5ErkJggg==',
      telCode: ''
    }
  }
}
</script>
<style lang="stylus">
.form
  .formTip
    display flex
    height 200px
    flex-direction column
    justify-content center
    align-items center
​
  .my-button
    margin-top 30px
</style>
​

src/views/register/step3.vue

<template>
  <div class="form">
     <div class="formTip">
      <van-image :src="img"></van-image>
      <p>请设置登录密码</p>
    </div>
    <van-field v-model="password" :type="type" placeholder="请输入登录密码" :right-icon="typeIcon" @click-right-icon="changeType"/>
    <div class="my-button">
      <van-button color="#ff6666" block round>完成</van-button>
    </div>
  </div>
</template>
<script>
import Vue from 'vue'
import { Field, Button, Image as VanImage } from 'vant'
Vue.use(Field)
Vue.use(Button)
Vue.use(VanImage)
export default {
  data () {
    return {
      type: 'password',
      typeIcon: 'closed-eye',
      img: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAACNCAYAAAAXU/AtAAAAAXNSR0IArs4c6QAAHz5JREFUeAHtXQm4XEWVPnX7rVnYshKIiLLIfCNjYjBBRQFBZRTEMaDAhwwMi6zfJySEQMA3EEG+AZ0BFwREASEa4gyCiBiWMHEkSAzOqIMIDotkgfACJCFv67415z+3zu3b/fot3a9vv9v97vm+ulV16tT21//Oq7u2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Y9vbGw4PmGXaxh2S1D1vOFCXaEgCY24z/vASX50wB/OCBDc7imee5kME9AVYwYoxm/GH554JCxOeaFgCA/eZf35l/Z577vsR43nXcTa9NjEAGXNbOi0wAlbAbACzRKqT93XKKsNkVq3CmfRCZu8qjm/nMIlDKnkEOntfevGUmc+98gA990peWyephvbA0TXgf494+GQWh9VR/RhPr7aeN2vKAw8l4sGcStai4T1wFBScoFhrP8q60zhcy2GsemNcoVnUtmDBbYxJXW+txowH5gUTwYJxwLe79uNwC4e6XkCZ1DAPMneec1sms1/7woXfq3fyYtpjygNH15kXD+9xnckeGWT+Joc50fIGTK/1rD2vZeHCUXl7uAHxTNaUmMhHcfgvDo0mmNNRyUI7HU1sCPBiH8phZQOwGHM4NDagEtJw+tzhAAvBi38QF53O4XgOuwxgljQ1fhCPPwxOt/IWqWafOB1NEFICD4E+E7mVTY7m8EUOn+TAv56UKOFPSRJ+FOcODvczcWvyZfSkIJASuIyVYDJPZvPPcDjchellVK+m6SZuDL/BhvBTJm3svwZUzcFXs62UwCNAkwl9AFdXMs/m9Ds4VPvSpM9tvszhtxwe4/AoE7ZunlXg8cYqKYGrCC8Tuo2b25fD/pEwjdMTOUxwMdIIEHzLVMN2l36V42cj4TkmbOSre1ySSojA/wPEnUJCeh9QLwAAAABJRU5ErkJggg==',
      password: ''
    }
  },
  methods: {
    changeType () {
      this.type = this.type === 'password' ? 'text' : 'password'
      this.typeIcon = this.type === 'password' ? 'closed-eye' : 'eye-o'
    }
  }
}
</script>
<style lang="stylus">
.form
  .formTip
    display flex
    height 200px
    flex-direction column
    justify-content center
    align-items center
​
  .my-button
    margin-top 30px
</style>
​

需要使用嵌套路由,修正代码

嵌套路由 | Vue Router

<template>
  <div class="box">
    <header class="header">
      <van-nav-bar
        title="嗨购注册"
        left-arrow
        @click-left="$router.back()"
      ></van-nav-bar>
    </header>
    <div class="content">
      <router-view></router-view>
    </div>
  </div>
</template>
<script>
import Vue from 'vue'
import { NavBar } from 'vant'
Vue.use(NavBar)
export default {
​
}
</script>
​
<style lang="stylus">
.container .box .content
  padding 30px 15px
  background-color #ffffff
</style>
​

10.2 编写注册路由

嵌套路由 嵌套路由 | Vue Router

Src/router/index.js

{
    path: '/register',
    name: 'register',
    component: () => import(/* webpackChunkName: 'user' */'../views/register/index.vue'),
    meta: { // 路由元信息
      hidden: true // 不显示底部选项卡
    },
    children: [
      {
        path: 'step1',
        name: 'registerStep1',
        component: () => import(/* webpackChunkName: 'user' */'../views/register/step1.vue'),
        meta: { hidden: true }
      },
      {
        path: 'step2',
        name: 'registerStep2',
        component: () => import(/* webpackChunkName: 'user' */'../views/register/step2.vue'),
        meta: { hidden: true }
      },
      {
        path: 'step3',
        name: 'registerStep3',
        component: () => import(/* webpackChunkName: 'user' */'../views/register/step3.vue'),
        meta: { hidden: true }
      }
    ]
  },
  {
    path: '*', // 404   ----   路由懒加载  ---- 一般用不到
    component: () => import(/* webpackChunkName: 'error' */'../views/error/notFound.vue')
  }

浏览器输入http://localhost:8080/register http://localhost:8080/register/step1 http://localhost:8080/register/step2 ``http://localhost:8080/register/step3 测试

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值