Convert EnvironmentIndicator component to Composition API (#125)

This commit is contained in:
Mysterious_Dev 2023-11-14 23:35:41 +01:00 committed by GitHub
parent 74e6caf633
commit 200648275e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,9 +47,10 @@
</template>
</span>
</template>
<script setup>
<script setup lang="ts">
import { GlobeIcon, ClientIcon, ServerIcon, InfoIcon } from '@'
import { useVIntl, defineMessages } from '@vintl/vintl'
const messages = defineMessages({
clientLabel: {
id: 'omorphia.component.environment-indicator.label.client',
@ -77,50 +78,27 @@ const messages = defineMessages({
},
})
const { formatMessage } = useVIntl()
</script>
<script>
import { defineComponent } from 'vue'
export default defineComponent({
props: {
type: {
type: String,
default: 'mod',
},
serverSide: {
type: String,
required: false,
default: '',
},
clientSide: {
type: String,
required: false,
default: '',
},
typeOnly: {
type: Boolean,
required: false,
default: false,
},
alwaysShow: {
type: Boolean,
required: false,
default: false,
},
search: {
type: Boolean,
required: false,
default: false,
},
categories: {
type: Array,
required: false,
default() {
return []
},
},
},
})
withDefaults(
defineProps<{
type: string
serverSide?: string
clientSide?: string
typeOnly?: boolean
alwaysShow?: boolean
search?: boolean
categories?: string[]
}>(),
{
type: 'mod',
serverSide: '',
clientSide: '',
typeOnly: false,
alwaysShow: false,
search: false,
categories: () => [],
}
)
</script>
<style lang="scss" scoped>
.environment {