Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7699c8

Browse files
committed
chore(vue3): avoid patching global Vue.extend
* use own extend instead
1 parent 725d31b commit c7699c8

File tree

176 files changed

+361
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+361
-362
lines changed

.eslintrc.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ module.exports = {
1515
es6: true,
1616
'jest/globals': true
1717
},
18-
globals: {
19-
Vue: true
20-
},
2118
rules: {
2219
'no-unused-vars': [
2320
'error',

src/components/alert/alert.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { COMPONENT_UID_KEY, Vue } from '../../vue'
21
import { NAME_ALERT } from '../../constants/components'
32
import { EVENT_NAME_DISMISSED, EVENT_NAME_DISMISS_COUNT_DOWN } from '../../constants/events'
43
import {
@@ -7,13 +6,14 @@ import {
76
PROP_TYPE_STRING
87
} from '../../constants/props'
98
import { SLOT_NAME_DISMISS } from '../../constants/slots'
9+
import { normalizeSlotMixin } from '../../mixins/normalize-slot'
1010
import { requestAF } from '../../utils/dom'
1111
import { isBoolean, isNumeric } from '../../utils/inspect'
1212
import { makeModelMixin } from '../../utils/model'
1313
import { toInteger } from '../../utils/number'
1414
import { sortKeys } from '../../utils/object'
1515
import { makeProp, makePropsConfigurable } from '../../utils/props'
16-
import { normalizeSlotMixin } from '../../mixins/normalize-slot'
16+
import { COMPONENT_UID_KEY, extend } from '../../vue'
1717
import { BButtonClose } from '../button/button-close'
1818
import { BVTransition } from '../transition/bv-transition'
1919

@@ -68,7 +68,7 @@ export const props = makePropsConfigurable(
6868
// --- Main component ---
6969

7070
// @vue/component
71-
export const BAlert = /*#__PURE__*/ Vue.extend({
71+
export const BAlert = /*#__PURE__*/ extend({
7272
name: NAME_ALERT,
7373
mixins: [modelMixin, normalizeSlotMixin],
7474
props,

src/components/aspect/aspect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue } from '../../vue'
1+
import { extend } from '../../vue'
22
import { NAME_ASPECT } from '../../constants/components'
33
import { PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props'
44
import { RX_ASPECT, RX_ASPECT_SEPARATOR } from '../../constants/regex'
@@ -26,7 +26,7 @@ export const props = makePropsConfigurable(
2626
// --- Main component ---
2727

2828
// @vue/component
29-
export const BAspect = /*#__PURE__*/ Vue.extend({
29+
export const BAspect = /*#__PURE__*/ extend({
3030
name: NAME_ASPECT,
3131
mixins: [normalizeSlotMixin],
3232
props,

src/components/avatar/avatar-group.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { Vue } from '../../vue'
21
import { NAME_AVATAR_GROUP } from '../../constants/components'
32
import {
43
PROP_TYPE_BOOLEAN,
54
PROP_TYPE_BOOLEAN_STRING,
65
PROP_TYPE_NUMBER_STRING,
76
PROP_TYPE_STRING
87
} from '../../constants/props'
8+
import { normalizeSlotMixin } from '../../mixins/normalize-slot'
99
import { mathMax, mathMin } from '../../utils/math'
1010
import { toFloat } from '../../utils/number'
1111
import { makeProp, makePropsConfigurable } from '../../utils/props'
12-
import { normalizeSlotMixin } from '../../mixins/normalize-slot'
12+
import { extend } from '../../vue'
1313
import { computeSize } from './avatar'
1414

1515
// --- Props ---
@@ -33,7 +33,7 @@ export const props = makePropsConfigurable(
3333
// --- Main component ---
3434

3535
// @vue/component
36-
export const BAvatarGroup = /*#__PURE__*/ Vue.extend({
36+
export const BAvatarGroup = /*#__PURE__*/ extend({
3737
name: NAME_AVATAR_GROUP,
3838
mixins: [normalizeSlotMixin],
3939
provide() {

src/components/avatar/avatar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue } from '../../vue'
1+
import { extend } from '../../vue'
22
import { NAME_AVATAR } from '../../constants/components'
33
import { EVENT_NAME_CLICK, EVENT_NAME_IMG_ERROR } from '../../constants/events'
44
import {
@@ -67,7 +67,7 @@ export const props = makePropsConfigurable(
6767
// --- Main component ---
6868

6969
// @vue/component
70-
export const BAvatar = /*#__PURE__*/ Vue.extend({
70+
export const BAvatar = /*#__PURE__*/ extend({
7171
name: NAME_AVATAR,
7272
mixins: [normalizeSlotMixin],
7373
inject: {

src/components/badge/badge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue, mergeData } from '../../vue'
1+
import { extend, mergeData } from '../../vue'
22
import { NAME_BADGE } from '../../constants/components'
33
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props'
44
import { omit, sortKeys } from '../../utils/object'
@@ -25,7 +25,7 @@ export const props = makePropsConfigurable(
2525
// --- Main component ---
2626

2727
// @vue/component
28-
export const BBadge = /*#__PURE__*/ Vue.extend({
28+
export const BBadge = /*#__PURE__*/ extend({
2929
name: NAME_BADGE,
3030
functional: true,
3131
props,

src/components/breadcrumb/breadcrumb-item.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue, mergeData } from '../../vue'
1+
import { extend, mergeData } from '../../vue'
22
import { NAME_BREADCRUMB_ITEM } from '../../constants/components'
33
import { makePropsConfigurable } from '../../utils/props'
44
import { BBreadcrumbLink, props as BBreadcrumbLinkProps } from './breadcrumb-link'
@@ -10,7 +10,7 @@ export const props = makePropsConfigurable(BBreadcrumbLinkProps, NAME_BREADCRUMB
1010
// --- Main component ---
1111

1212
// @vue/component
13-
export const BBreadcrumbItem = /*#__PURE__*/ Vue.extend({
13+
export const BBreadcrumbItem = /*#__PURE__*/ extend({
1414
name: NAME_BREADCRUMB_ITEM,
1515
functional: true,
1616
props,

src/components/breadcrumb/breadcrumb-link.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue, mergeData } from '../../vue'
1+
import { extend, mergeData } from '../../vue'
22
import { NAME_BREADCRUMB_LINK } from '../../constants/components'
33
import { PROP_TYPE_STRING } from '../../constants/props'
44
import { htmlOrText } from '../../utils/html'
@@ -21,7 +21,7 @@ export const props = makePropsConfigurable(
2121
// --- Main component ---
2222

2323
// @vue/component
24-
export const BBreadcrumbLink = /*#__PURE__*/ Vue.extend({
24+
export const BBreadcrumbLink = /*#__PURE__*/ extend({
2525
name: NAME_BREADCRUMB_LINK,
2626
functional: true,
2727
props,

src/components/breadcrumb/breadcrumb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue, mergeData } from '../../vue'
1+
import { extend, mergeData } from '../../vue'
22
import { NAME_BREADCRUMB } from '../../constants/components'
33
import { PROP_TYPE_ARRAY } from '../../constants/props'
44
import { isArray, isObject } from '../../utils/inspect'
@@ -18,7 +18,7 @@ export const props = makePropsConfigurable(
1818
// --- Main component ---
1919

2020
// @vue/component
21-
export const BBreadcrumb = /*#__PURE__*/ Vue.extend({
21+
export const BBreadcrumb = /*#__PURE__*/ extend({
2222
name: NAME_BREADCRUMB,
2323
functional: true,
2424
props,

src/components/button-group/button-group.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Vue, mergeData } from '../../vue'
1+
import { extend, mergeData } from '../../vue'
22
import { NAME_BUTTON_GROUP } from '../../constants/components'
33
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props'
44
import { pick, sortKeys } from '../../utils/object'
@@ -21,7 +21,7 @@ export const props = makePropsConfigurable(
2121
// --- Main component ---
2222

2323
// @vue/component
24-
export const BButtonGroup = /*#__PURE__*/ Vue.extend({
24+
export const BButtonGroup = /*#__PURE__*/ extend({
2525
name: NAME_BUTTON_GROUP,
2626
functional: true,
2727
props,

0 commit comments

Comments
 (0)