refactor(client): refactor admin/other-settings to use Composition API (#8667)
This commit is contained in:
		
							parent
							
								
									67f3515dc1
								
							
						
					
					
						commit
						81fccb5656
					
				
					 1 changed files with 22 additions and 39 deletions
				
			
		|  | @ -6,52 +6,35 @@ | |||
| </MkSpacer> | ||||
| </template> | ||||
| 
 | ||||
| <script lang="ts"> | ||||
| import { defineComponent } from 'vue'; | ||||
| import FormSwitch from '@/components/form/switch.vue'; | ||||
| import FormInput from '@/components/form/input.vue'; | ||||
| import FormSection from '@/components/form/section.vue'; | ||||
| <script lang="ts" setup> | ||||
| import { } from 'vue'; | ||||
| import FormSuspense from '@/components/form/suspense.vue'; | ||||
| import * as os from '@/os'; | ||||
| import * as symbols from '@/symbols'; | ||||
| import { fetchInstance } from '@/instance'; | ||||
| import { i18n } from '@/i18n'; | ||||
| 
 | ||||
| export default defineComponent({ | ||||
| 	components: { | ||||
| 		FormSwitch, | ||||
| 		FormInput, | ||||
| 		FormSection, | ||||
| 		FormSuspense, | ||||
| 	}, | ||||
| async function init() { | ||||
| 	await os.api('admin/meta'); | ||||
| } | ||||
| 
 | ||||
| 	emits: ['info'], | ||||
| function save() { | ||||
| 	os.apiWithDialog('admin/update-meta').then(() => { | ||||
| 		fetchInstance(); | ||||
| 	}); | ||||
| } | ||||
| 
 | ||||
| 	data() { | ||||
| 		return { | ||||
| 			[symbols.PAGE_INFO]: { | ||||
| 				title: this.$ts.other, | ||||
| 				icon: 'fas fa-cogs', | ||||
| 				bg: 'var(--bg)', | ||||
| 				actions: [{ | ||||
| 					asFullButton: true, | ||||
| 					icon: 'fas fa-check', | ||||
| 					text: this.$ts.save, | ||||
| 					handler: this.save, | ||||
| 				}], | ||||
| 			}, | ||||
| 		} | ||||
| 	}, | ||||
| 
 | ||||
| 	methods: { | ||||
| 		async init() { | ||||
| 			const meta = await os.api('admin/meta'); | ||||
| 		}, | ||||
| 		save() { | ||||
| 			os.apiWithDialog('admin/update-meta', { | ||||
| 			}).then(() => { | ||||
| 				fetchInstance(); | ||||
| 			}); | ||||
| 		} | ||||
| defineExpose({ | ||||
|   [symbols.PAGE_INFO]: { | ||||
| 		title: i18n.ts.other, | ||||
| 		icon: 'fas fa-cogs', | ||||
| 		bg: 'var(--bg)', | ||||
| 		actions: [{ | ||||
| 			asFullButton: true, | ||||
| 			icon: 'fas fa-check', | ||||
| 			text: i18n.ts.save, | ||||
| 			handler: save, | ||||
| 		}], | ||||
| 	} | ||||
| }); | ||||
| </script> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue