🌐 AI搜索 & 代理 主页
Skip to content

Commit 86bbb7f

Browse files
committed
fix: further improve user supplied prop fucntion detection
1 parent 53fdb11 commit 86bbb7f

File tree

6 files changed

+7
-11
lines changed

6 files changed

+7
-11
lines changed

src/components/calendar/calendar.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,14 +342,12 @@ export const BCalendar = Vue.extend({
342342
},
343343
computedDateDisabledFn() {
344344
const { dateDisabledFn } = this
345-
return dateDisabledFn.name !== props.dateDisabledFn.default.name
346-
? dateDisabledFn
347-
: () => false
345+
return dateDisabledFn !== props.dateDisabledFn.default ? dateDisabledFn : () => false
348346
},
349347
// TODO: Change `dateInfoFn` to handle events and notes as well as classes
350348
computedDateInfoFn() {
351349
const { dateInfoFn } = this
352-
return dateInfoFn.name !== props.dateInfoFn.default.name ? dateInfoFn : () => ({})
350+
return dateInfoFn !== props.dateInfoFn.default ? dateInfoFn : () => ({})
353351
},
354352
calendarLocale() {
355353
// This locale enforces the gregorian calendar (for use in formatter functions)

src/components/form-file/form-file.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export const BFormFile = /*#__PURE__*/ Vue.extend({
273273
},
274274
computedFileNameFormatter() {
275275
const { fileNameFormatter } = this
276-
return fileNameFormatter.name !== props.fileNameFormatter.default.name
276+
return fileNameFormatter !== props.fileNameFormatter.default
277277
? fileNameFormatter
278278
: this.defaultFileNameFormatter
279279
},

src/components/form-spinbutton/form-spinbutton.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,7 @@ export const BFormSpinbutton = /*#__PURE__*/ Vue.extend({
223223
},
224224
computedFormatter() {
225225
const { formatterFn } = this
226-
return formatterFn.name !== props.formatterFn.default.name
227-
? formatterFn
228-
: this.defaultFormatter
226+
return formatterFn !== props.formatterFn.default ? formatterFn : this.defaultFormatter
229227
},
230228
computedAttrs() {
231229
return {

src/components/form-tags/form-tags.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ export const BFormTags = /*#__PURE__*/ Vue.extend({
535535
},
536536
validateTag(tag) {
537537
const { tagValidator } = this
538-
return tagValidator.name !== props.tagValidator.default.name ? tagValidator(tag) : true
538+
return tagValidator !== props.tagValidator.default ? tagValidator(tag) : true
539539
},
540540
getInput() {
541541
// Returns the input element reference (or null if not found)

src/components/table/helpers/mixin-filtering.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export default {
9191
localFilterFn() {
9292
// Return `null` to signal to use internal filter function
9393
const { filterFunction } = this
94-
return filterFunction.name !== props.filterFunction.default.name ? filterFunction : null
94+
return filterFunction !== props.filterFunction.default ? filterFunction : null
9595
},
9696
// Returns the records in `localItems` that match the filter criteria
9797
// Returns the original `localItems` array if not sorting

src/mixins/form-text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default {
100100
return mathMax(toInteger(this.debounce, 0), 0)
101101
},
102102
hasFormatter() {
103-
return this.formatter.name !== props.formatter.default.name
103+
return this.formatter !== props.formatter.default
104104
}
105105
},
106106
watch: {

0 commit comments

Comments
 (0)