<script setup>
import {Base64} from 'js-base64'
import {ref} from 'vue'
const props = defineProps({
    activeModel:{//当前选择的登陆模式
        type:String,
        default:'ordinaryModel'
    }
})

//账号密码
let username=ref(localStorage.getItem('account')?Base64.decode(localStorage.getItem('account')):'')
let password=ref(localStorage.getItem('checkPass')?Base64.decode(localStorage.getItem('checkPass')):'')

const emit = defineEmits(['changeModel'])
function changeModel(){
    emit('changeModel')
}
</script>

<template>
    <van-field
        class="form-input-box"
        v-model="username"
        name="username"
        placeholder="请输入管理后台账号"
        :rules="[{ required: true, message: '请填写账号' }]"
    />
    <van-field
        class="form-input-box"
        v-model="password"
        type="password"
        name="password"
        placeholder="请输入密码"
        :rules="[{ required: true, message: '请填写密码' }]"
    >
        <template #button>
            <span class="btn-text" style="color:#0052D9;" @click="changeModel">忘记密码</span>
        </template>
    </van-field>
</template>

<style scoped lang="scss">
@import "./style/common.scss";
</style>
