Skip to content

Commit

Permalink
fix: success message not rendered
Browse files Browse the repository at this point in the history
  • Loading branch information
ComfortablyCoding committed Aug 1, 2024
1 parent 48d0a76 commit 2502355
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/base/UForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ watch(
<div class="mb-4">
<VAlert v-if="error" type="error">Oops! {{ error }}</VAlert>
<VAlert v-if="form.on_success === 'message' && success" type="success">
{{ form.success_message ?? 'Success! Your form has been submitted.' }}
<div v-if="form.success_message" v-dompurify-html="form.success_message"></div>
<p v-else>Success! Your form has been submitted.</p>
</VAlert>
</div>
<div>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"stripe": "^16.5.0",
"uuid": "^10.0.0",
"v-perfect-signature": "^1.4.0",
"vue": "^3.4.34"
"vue": "^3.4.34",
"vue-dompurify-html": "^5.1.0"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
5 changes: 5 additions & 0 deletions plugins/dompurify-html.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import VueDOMPurifyHTML from 'vue-dompurify-html';

export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.use(VueDOMPurifyHTML);
});
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2502355

Please sign in to comment.