perf: dynamic options demo
This commit is contained in:
parent
5e292f8a2b
commit
9a3b6177aa
|
@ -25,6 +25,8 @@ service.interceptors.request.use(
|
|||
) {
|
||||
config.data = qs.stringify(config.data)
|
||||
}
|
||||
// 添加token,可根据实际业务修改
|
||||
// config!.headers!['Authorization'] = 'something'
|
||||
// get参数编码
|
||||
if (config.method === 'get' && config.params) {
|
||||
let url = config.url as string
|
||||
|
|
|
@ -341,7 +341,8 @@ export default {
|
|||
position: 'position',
|
||||
left: 'left',
|
||||
center: 'center',
|
||||
right: 'right'
|
||||
right: 'right',
|
||||
dynamicOptions: 'Dynamic options'
|
||||
},
|
||||
stickyDemo: {
|
||||
sticky: 'Sticky'
|
||||
|
|
|
@ -338,7 +338,8 @@ export default {
|
|||
position: '位置',
|
||||
left: '左',
|
||||
center: '中',
|
||||
right: '右'
|
||||
right: '右',
|
||||
dynamicOptions: '动态选项'
|
||||
},
|
||||
stickyDemo: {
|
||||
sticky: '黏性'
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Search } from '@/components/Search'
|
|||
import { reactive, ref, unref } from 'vue'
|
||||
import { useValidator } from '@/hooks/web/useValidator'
|
||||
import { ElButton } from 'element-plus'
|
||||
import { getDictOneApi } from '@/api/common'
|
||||
|
||||
const { required } = useValidator()
|
||||
|
||||
|
@ -174,6 +175,14 @@ const changePosition = (position: string) => {
|
|||
layout.value = 'bottom'
|
||||
buttomPosition.value = position
|
||||
}
|
||||
|
||||
const getDictOne = async () => {
|
||||
const res = await getDictOneApi()
|
||||
if (res) {
|
||||
schema[1].componentProps!.options = res.data
|
||||
console.log(res.data)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
@ -196,6 +205,9 @@ const changePosition = (position: string) => {
|
|||
<ElButton @click="changePosition('right')">
|
||||
{{ t('searchDemo.bottom') }} {{ t('searchDemo.position') }}-{{ t('searchDemo.right') }}
|
||||
</ElButton>
|
||||
<ElButton @click="getDictOne">
|
||||
{{ t('searchDemo.dynamicOptions') }}
|
||||
</ElButton>
|
||||
</ContentWrap>
|
||||
|
||||
<ContentWrap :title="t('searchDemo.search')" :message="t('searchDemo.searchDes')">
|
||||
|
|
Loading…
Reference in New Issue