|
|
|
@ -3,6 +3,11 @@ import type { DefaultTheme } from 'vitepress/theme'
|
|
|
|
import { computed } from 'vue'
|
|
|
|
import { computed } from 'vue'
|
|
|
|
import VPFeature from './VPFeature.vue'
|
|
|
|
import VPFeature from './VPFeature.vue'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export interface FeatureGroup {
|
|
|
|
|
|
|
|
title?: string,
|
|
|
|
|
|
|
|
features: Feature[]
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export interface Feature {
|
|
|
|
export interface Feature {
|
|
|
|
icon?: DefaultTheme.FeatureIcon
|
|
|
|
icon?: DefaultTheme.FeatureIcon
|
|
|
|
title: string
|
|
|
|
title: string
|
|
|
|
@ -13,12 +18,15 @@ export interface Feature {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
const props = defineProps<{
|
|
|
|
features: Feature[]
|
|
|
|
features: FeatureGroup[]
|
|
|
|
}>()
|
|
|
|
}>()
|
|
|
|
|
|
|
|
|
|
|
|
const grid = computed(() => {
|
|
|
|
const grid = computed({
|
|
|
|
const length = props.features.length
|
|
|
|
get() {
|
|
|
|
|
|
|
|
return (idx: number) => {
|
|
|
|
|
|
|
|
const group = props.features[idx]
|
|
|
|
|
|
|
|
if (!group) return ''
|
|
|
|
|
|
|
|
const length = group.features.length
|
|
|
|
if (!length) {
|
|
|
|
if (!length) {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
} else if (length === 2) {
|
|
|
|
} else if (length === 2) {
|
|
|
|
@ -30,18 +38,34 @@ const grid = computed(() => {
|
|
|
|
} else if (length > 3) {
|
|
|
|
} else if (length > 3) {
|
|
|
|
return 'grid-4'
|
|
|
|
return 'grid-4'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const firstHeading = computed({
|
|
|
|
|
|
|
|
get() {
|
|
|
|
|
|
|
|
return (idx: number) => {
|
|
|
|
|
|
|
|
return idx === 0 ? 'first' : ''
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div v-if="features" class="VPFeatures">
|
|
|
|
<div v-if="features" class="VPFeatures">
|
|
|
|
|
|
|
|
<div class="section" v-for="(feature_group, feature_group_idx) in features">
|
|
|
|
|
|
|
|
<h2
|
|
|
|
|
|
|
|
class="feature-group-title"
|
|
|
|
|
|
|
|
:class="[firstHeading(feature_group_idx)]"
|
|
|
|
|
|
|
|
v-if="feature_group.title"
|
|
|
|
|
|
|
|
v-html="feature_group.title" />
|
|
|
|
<div class="container">
|
|
|
|
<div class="container">
|
|
|
|
<div class="items">
|
|
|
|
<div class="items">
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
v-for="feature in features"
|
|
|
|
v-for="feature in feature_group.features"
|
|
|
|
:key="feature.title"
|
|
|
|
:key="feature.title"
|
|
|
|
class="item"
|
|
|
|
class="item"
|
|
|
|
:class="[grid]"
|
|
|
|
:class="[grid(feature_group_idx)]"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<VPFeature
|
|
|
|
<VPFeature
|
|
|
|
:icon="feature.icon"
|
|
|
|
:icon="feature.icon"
|
|
|
|
@ -55,12 +79,16 @@ const grid = computed(() => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
<style scoped>
|
|
|
|
.VPFeatures {
|
|
|
|
.VPFeatures {
|
|
|
|
position: relative;
|
|
|
|
position: relative;
|
|
|
|
padding: 0 24px;
|
|
|
|
padding: 0 24px;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
gap: 24px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@media (min-width: 640px) {
|
|
|
|
@media (min-width: 640px) {
|
|
|
|
@ -75,8 +103,20 @@ const grid = computed(() => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.container {
|
|
|
|
h2.feature-group-title {
|
|
|
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
h2.feature-group-title.first {
|
|
|
|
|
|
|
|
margin-top: 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.section {
|
|
|
|
margin: 0 auto;
|
|
|
|
margin: 0 auto;
|
|
|
|
|
|
|
|
width: 100%;
|
|
|
|
max-width: 1152px;
|
|
|
|
max-width: 1152px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|