Use Composition API for settings index (#1613)

This commit is contained in:
Mysterious_Dev
2024-01-28 20:02:03 +01:00
committed by GitHub
parent ed731fd7a6
commit 5243d8bedf

View File

@@ -137,43 +137,30 @@
</div> </div>
</template> </template>
<script> <script setup>
import { Multiselect } from 'vue-multiselect' import { Multiselect } from 'vue-multiselect'
import { formatProjectType } from '~/plugins/shorthands.js'
export default defineNuxtComponent({ useHead({
components: { title: 'Display settings - Modrinth',
Multiselect, })
},
setup() {
const cosmetics = useCosmetics()
const tags = useTags()
return { cosmetics, tags } const cosmetics = useCosmetics()
}, const tags = useTags()
data() {
const listTypes = computed(() => {
const types = tags.value.projectTypes.map((type) => {
return { return {
searchDisplayMode: this.cosmetics.searchDisplayMode, id: type.id,
name: formatProjectType(type.id) + ' search',
display: 'the ' + formatProjectType(type.id).toLowerCase() + 's search page',
} }
}, })
head: { types.push({
title: 'Display settings - Modrinth', id: 'user',
}, name: 'User page',
computed: { display: 'user pages',
listTypes() { })
const types = this.tags.projectTypes.map((type) => { return types
return {
id: type.id,
name: this.$formatProjectType(type.id) + ' search',
display: 'the ' + this.$formatProjectType(type.id).toLowerCase() + 's search page',
}
})
types.push({
id: 'user',
name: 'User page',
display: 'user pages',
})
return types
},
},
}) })
</script> </script>