Skip to content

Commit

Permalink
Merge pull request #82 from rozsazoltan/v-html-support
Browse files Browse the repository at this point in the history
feat: Raw HTML support
  • Loading branch information
fatihsolhan authored Feb 9, 2024
2 parents ca97953 + 4b7a066 commit 8aa02b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion demo/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export default defineComponent({
},
content: {
title: 'Nice to see you here!',
description: 'You can use v-onboarding to show some information about your app, or to explain how to use it',
description: 'You can use <strong>v-onboarding</strong> to show some information about your app, or to explain how to use it',
html: true
}
},
{
Expand Down
2 changes: 2 additions & 0 deletions docs/pages/3.props/1.steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ title: steps
content: {
title: "..."
description: "..."
html: false
},
on: {
beforeStep: function (options) { ... },
Expand All @@ -29,6 +30,7 @@ title: steps
| `content` | `Object` | **Optional** |
| `content.title` | `String` | **Optional** | Title to use in onboarding step |
| `content.description` | `String` | **Optional** | Description to use in onboarding step |
| `content.html` | `Boolean` | **Optional** | If its set to `true`, the `content.description` will be rendered in the default template using [`v-html`](https://vuejs.org/guide/essentials/template-syntax.html#raw-html) |
| `on` | `Object` | **Optional** |
| `on.beforeStep` | `Function` `AsyncFunction` | **Optional** | Function to run before showing the step ([More information](/props/hooks#onBeforeStep)) |
| `on.afterStep ` | `Function` `AsyncFunction` | **Optional** | Function to run after showing the step ([More information](/props/hooks#onAfterStep)) |
Expand Down
7 changes: 6 additions & 1 deletion src/components/VOnboardingStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
</button>
</div>
<p
v-if="step.content.description"
v-if="step.content.description && step.content.html"
class="v-onboarding-item__description"
v-html="step.content.description"
/>
<p
v-else-if="step.content.description"
class="v-onboarding-item__description"
>{{ step.content.description }}</p>
<div class="v-onboarding-item__actions">
Expand Down
1 change: 1 addition & 0 deletions src/types/StepEntity.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface StepEntity {
content: {
title: string;
description?: string;
html?: boolean
}
on?: {
beforeStep?: (options?: onBeforeStepOptions) => void | Promise<void>
Expand Down

0 comments on commit 8aa02b3

Please sign in to comment.