Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Convert EnvironmentIndicator component to Composition API (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysterious-Dev authored Nov 14, 2023
1 parent 74e6caf commit 2006482
Showing 1 changed file with 22 additions and 44 deletions.
66 changes: 22 additions & 44 deletions lib/components/base/EnvironmentIndicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2006482

Please sign in to comment.