-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: null message on input help #343
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||||||||||||||
<template> | ||||||||||||||||||
<div class="flex mb-1 input-help"> | ||||||||||||||||||
<small :class="theme.default.help" class="grow flex"> | ||||||||||||||||||
<slot name="help"><span class="field-help" v-html="help" /></slot> | ||||||||||||||||||
<slot name="help"><span class="field-help" v-html="helpValue" /></slot> | ||||||||||||||||||
</small> | ||||||||||||||||||
<slot name="after-help"> | ||||||||||||||||||
<small class="flex-grow" /> | ||||||||||||||||||
|
@@ -16,6 +16,12 @@ export default { | |||||||||||||||||
props: { | ||||||||||||||||||
theme: { type: Object, required: true }, | ||||||||||||||||||
help: { type: String, required: false } | ||||||||||||||||||
}, | ||||||||||||||||||
|
||||||||||||||||||
computed: { | ||||||||||||||||||
helpValue(){ | ||||||||||||||||||
return (this.help === null || this.help === undefined) ? '' : this.help | ||||||||||||||||||
} | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The - return (this.help === null || this.help === undefined) ? '' : this.help
+ return this.help ?? '' Committable suggestion
Suggested change
|
||||||||||||||||||
} | ||||||||||||||||||
} | ||||||||||||||||||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
v-html
to dynamically render HTML can introduce security risks, particularly XSS vulnerabilities. Ensure that the content bound tov-html
is sanitized or trusted, especially if it could be influenced by user input. Consider alternatives likev-text
if HTML formatting is not required, or ensure proper sanitization of the content.