refactor: 重构useValidator

This commit is contained in:
kailong321200875
2023-08-16 16:17:35 +08:00
parent 71b0e4f6f6
commit b8849dabe2
8 changed files with 187 additions and 72 deletions

View File

@@ -2,49 +2,14 @@
import { ContentWrap } from '@/components/ContentWrap'
import { useI18n } from '@/hooks/web/useI18n'
import { ElButton } from 'element-plus'
import { driver } from 'driver.js'
import 'driver.js/dist/driver.css'
import { useDesign } from '@/hooks/web/useDesign'
import { useGuide } from '@/hooks/web/useGuide'
const { t } = useI18n()
const { variables } = useDesign()
const driverObj = driver({
showProgress: true,
nextBtnText: t('common.nextLabel'),
prevBtnText: t('common.prevLabel'),
doneBtnText: t('common.doneLabel'),
steps: [
{
element: `#${variables.namespace}-menu`,
popover: {
title: t('common.menu'),
description: t('common.menuDes'),
side: 'right'
}
},
{
element: `#${variables.namespace}-tool-header`,
popover: {
title: t('common.tool'),
description: t('common.toolDes'),
side: 'left'
}
},
{
element: `#${variables.namespace}-tags-view`,
popover: {
title: t('common.tagsView'),
description: t('common.tagsViewDes'),
side: 'bottom'
}
}
]
})
const { drive } = useGuide()
const guideStart = () => {
driverObj.drive()
drive()
}
</script>