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)
|
const formModel = useVModel(props, 'model', emit)
|
||||||
|
|
||||||
watch(() => props.options, (options) => {
|
const initFormModel = () => {
|
||||||
options.forEach(option => {
|
if (formModel.value) {
|
||||||
if (formModel.value) {
|
props.options.forEach(option => {
|
||||||
formModel.value[option.prop] = option.value || undefined
|
if (option.prop) {
|
||||||
}
|
formModel.value[option.prop] = option.value || undefined
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
rules.value = initRules()
|
rules.value = initRules()
|
||||||
}, { deep: true })
|
}
|
||||||
|
|
||||||
|
initFormModel()
|
||||||
|
|
||||||
|
watch(() => props.options, initFormModel, { deep: true })
|
||||||
|
|
||||||
//= ============form暴露============//
|
//= ============form暴露============//
|
||||||
|
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ export const useBaseTopMenus = () => {
|
|||||||
{
|
{
|
||||||
icon: 'user',
|
icon: 'user',
|
||||||
isDropdown: true,
|
isDropdown: true,
|
||||||
label: $i18nMsg(loginConfigStore.accountInfo.userNameCN, loginConfigStore.accountInfo.userNameEN),
|
label: loginConfigStore.accountInfo ? $i18nMsg(loginConfigStore.accountInfo.userNameCN, loginConfigStore.accountInfo.userNameEN) : '',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
labelKey: 'common.label.personalInfo',
|
labelKey: 'common.label.personalInfo',
|
||||||
|
|||||||
Reference in New Issue
Block a user