Skip to content

Commit

Permalink
chore: simplify components slot
Browse files Browse the repository at this point in the history
  • Loading branch information
farnabaz committed May 28, 2021
1 parent 1520951 commit 63fc12f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/defaultTheme/components/atoms/Alert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="p-4 mt-4 mb-4 rounded-md alert" :class="[type]">
<div class="flex items-start">
<div class="flex-grow alert-content">
<Markdown :node="$slots.default" unwrap="p" />
<Markdown unwrap="p" />
</div>
</div>
</div>
Expand Down
11 changes: 3 additions & 8 deletions src/defaultTheme/components/atoms/ButtonLink.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template>
<NuxtLink v-if="isInternal" :to="href" class="button-link" :class="[size, bold ? 'font-semibold' : 'font-medium']">
<Markdown :node="content" />
<Markdown unwrap="p ul li" />
</NuxtLink>

<a v-else :href="href" class="button-link" :class="[size, bold ? 'font-semibold' : 'font-medium']" v-bind="linkAttrs">
<Markdown :node="content" />
<Markdown unwrap="p ul li" />
<IconExternalLink v-if="blank" class="w-4 h-4 ml-2" />
</a>
</template>

<script>
import { computed, defineComponent } from '@nuxtjs/composition-api'
import { flatUnwrap, Markdown } from '~docus/utils'
import { Markdown } from '~docus/utils'
export default defineComponent({
components: { Markdown },
Expand Down Expand Up @@ -42,11 +42,6 @@ export default defineComponent({
isInternal,
linkAttrs
}
},
computed: {
content() {
return flatUnwrap(this.$slots.default, ['p', 'ul', 'li'])
}
}
})
</script>
Expand Down

0 comments on commit 63fc12f

Please sign in to comment.