<template> <view> <ChangePhone v-if="type === 'phone'" :phone="phone" /> <ChangeLoginPass v-if="type === 'login'" :phone="phone" /> <ChangePayPass v-if="type === 'pay'" :phone="phone" /> </view> </template> <script> import ChangePhone from './components/changephone.vue'; import ChangeLoginPass from './components/changeLoginPass.vue'; import ChangePayPass from './components/changePayPass.vue'; export default { data() { return { type: '', phone: '' } }, onLoad(option) { this.type = option.type; this.phone = option.phone || ''; }, components: { ChangePhone, ChangeLoginPass, ChangePayPass } } </script> <style lang="less" scoped> </style>