🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/popover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,11 @@
"slots": [
{
"name": "title",
"description": "Optional slot for title (HTML supported)"
"description": "Optional slot for title (HTML/components supported)"
},
{
"name": "default",
"description": "Slot for content (HTML supported)"
"description": "Slot for content (HTML/components supported)"
}
]
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/popover/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const BPopover = /*#__PURE__*/ Vue.extend({
default: () => getComponentConfig(NAME, 'boundary')
},
boundaryPadding: {
type: Number,
type: [Number, String],
default: () => getComponentConfig(NAME, 'boundaryPadding')
}
},
Expand All @@ -59,7 +59,7 @@ export const BPopover = /*#__PURE__*/ Vue.extend({
updateContent() {
// Tooltip: Default slot is `title`
// Popover: Default slot is `content`, `title` slot is title
// We pass a scoped slot function by default (v2.6x)
// We pass a scoped slot function references by default (Vue v2.6x)
// And pass the title prop as a fallback
this.setContent(this.$scopedSlots.default || this.content)
this.setTitle(this.$scopedSlots.title || this.title)
Expand Down
9 changes: 5 additions & 4 deletions src/components/tooltip/helpers/bv-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,12 @@ export const BVTooltip = /*#__PURE__*/ Vue.extend({
html: this.html,
placement: this.placement,
fallbackPlacement: this.fallbackPlacement,
offset: this.offset,
arrowPadding: this.arrowPadding,
boundaryPadding: this.boundaryPadding,
target: this.getPlacementTarget(),
boundary: this.getBoundary(),
target: this.getPlacementTarget()
// Ensure the following are integers
offset: parseInt(this.offset, 10) || 0,
arrowPadding: parseInt(this.arrowPadding, 10) || 0,
boundaryPadding: parseInt(this.boundaryPadding, 10) || 0
}
}))
// We set the initial reactive data (values that can be changed while open)
Expand Down
2 changes: 1 addition & 1 deletion src/components/tooltip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"slots": [
{
"name": "default",
"description": "Slot for tooltip content (HTML supported)"
"description": "Slot for tooltip content (HTML/components supported)"
}
]
}
Expand Down
7 changes: 5 additions & 2 deletions src/components/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const BTooltip = /*#__PURE__*/ Vue.extend({
default: () => getComponentConfig(NAME, 'boundary')
},
boundaryPadding: {
type: Number,
type: [Number, String],
default: () => getComponentConfig(NAME, 'boundaryPadding')
},
offset: {
Expand Down Expand Up @@ -122,6 +122,7 @@ export const BTooltip = /*#__PURE__*/ Vue.extend({
customClass: this.customClass,
container: this.container,
boundary: this.boundary,
boundaryPadding: this.boundaryPadding,
delay: this.delay,
offset: this.offset,
noFade: this.noFade,
Expand Down Expand Up @@ -244,19 +245,21 @@ export const BTooltip = /*#__PURE__*/ Vue.extend({
// Overridden by BPopover
// Tooltip: Default slot is `title`
// Popover: Default slot is `content`, `title` slot is title
// We pass a scoped slot function by default (v2.6x)
// We pass a scoped slot function reference by default (Vue v2.6x)
// And pass the title prop as a fallback
this.setTitle(this.$scopedSlots.default || this.title)
},
// Helper methods for `updateContent()`
setTitle(val) {
val = isUndefinedOrNull(val) ? '' : val
// We only update the value if it has changed
if (this.localTitle !== val) {
this.localTitle = val
}
},
setContent(val) {
val = isUndefinedOrNull(val) ? '' : val
// We only update the value if it has changed
if (this.localContent !== val) {
this.localContent = val
}
Expand Down
10 changes: 5 additions & 5 deletions src/directives/popover/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { getComponentConfig } from '../../utils/config'
import { isBrowser } from '../../utils/env'
import {
isFunction,
isObject,
isNumber,
isPlainObject,
isString,
isUndefined,
isUndefinedOrNull
Expand Down Expand Up @@ -71,7 +71,7 @@ const parseBindings = (bindings, vnode) => /* istanbul ignore next: not easy to
} else if (isFunction(bindings.value)) {
// Content generator function
config.content = bindings.value
} else if (isObject(bindings.value)) {
} else if (isPlainObject(bindings.value)) {
// Value is config object, so merge
config = { ...config, ...bindings.value }
}
Expand All @@ -91,10 +91,10 @@ const parseBindings = (bindings, vnode) => /* istanbul ignore next: not easy to
}

// Normalize delay
if (!isObject(config.delay)) {
if (!isPlainObject(config.delay)) {
config.delay = {
show: config.delay,
hide: config.delay
show: parseInt(config.delay, 10) || 0,
hide: parseInt(config.delay, 10) || 0
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/directives/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isBrowser } from '../../utils/env'
import {
isFunction,
isNumber,
isObject,
isPlainObject,
isString,
isUndefined,
isUndefinedOrNull
Expand Down Expand Up @@ -71,7 +71,7 @@ const parseBindings = (bindings, vnode) => /* istanbul ignore next: not easy to
} else if (isFunction(bindings.value)) {
// Title generator function
config.title = bindings.value
} else if (isObject(bindings.value)) {
} else if (isPlainObject(bindings.value)) {
// Value is config object, so merge
config = { ...config, ...bindings.value }
}
Expand All @@ -84,10 +84,10 @@ const parseBindings = (bindings, vnode) => /* istanbul ignore next: not easy to
}

// Normalize delay
if (!isObject(config.delay)) {
if (!isPlainObject(config.delay)) {
config.delay = {
show: config.delay,
hide: config.delay
show: parseInt(config.delay, 10) || 0,
hide: parseInt(config.delay, 10) || 0
}
}

Expand Down