Skip to content

Commit

Permalink
perf: 更新demo
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Aug 25, 2023
1 parent b6ee4e5 commit 2c99cd2
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/views/Components/Form/DefaultForm.vue
Expand Up @@ -442,6 +442,15 @@ const treeSelectData = [
}
]
// 模拟远程加载
const getTreeSelectData = () => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(treeSelectData)
}, 3000)
})
}
let id = 0
const imageUrl = ref('')
Expand Down Expand Up @@ -1533,8 +1542,9 @@ const schema = reactive<FormSchema[]>([
label: `${t('formDemo.treeSelect')}`,
component: 'TreeSelect',
// 远程加载option
optionApi: () => {
return treeSelectData
optionApi: async () => {
const res = await getTreeSelectData()
return res
}
},
{
Expand Down

0 comments on commit 2c99cd2

Please sign in to comment.