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