mirror of
https://github.com/fugary/simple-element-plus-template.git
synced 2025-11-12 14:27:49 +00:00
表单进入验证没有问题
This commit is contained in:
@@ -95,14 +95,20 @@ const emit = defineEmits(['submitForm', 'update:model'])
|
||||
|
||||
const formModel = useVModel(props, 'model', emit)
|
||||
|
||||
watch(() => props.options, (options) => {
|
||||
options.forEach(option => {
|
||||
const initFormModel = () => {
|
||||
if (formModel.value) {
|
||||
props.options.forEach(option => {
|
||||
if (option.prop) {
|
||||
formModel.value[option.prop] = option.value || undefined
|
||||
}
|
||||
})
|
||||
}
|
||||
rules.value = initRules()
|
||||
}, { deep: true })
|
||||
}
|
||||
|
||||
initFormModel()
|
||||
|
||||
watch(() => props.options, initFormModel, { deep: true })
|
||||
|
||||
//= ============form暴露============//
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ export const useBaseTopMenus = () => {
|
||||
{
|
||||
icon: 'user',
|
||||
isDropdown: true,
|
||||
label: $i18nMsg(loginConfigStore.accountInfo.userNameCN, loginConfigStore.accountInfo.userNameEN),
|
||||
label: loginConfigStore.accountInfo ? $i18nMsg(loginConfigStore.accountInfo.userNameCN, loginConfigStore.accountInfo.userNameEN) : '',
|
||||
children: [
|
||||
{
|
||||
labelKey: 'common.label.personalInfo',
|
||||
|
||||
Reference in New Issue
Block a user