Skip to content

Commit

Permalink
fix: change _isVue references to vue3's __isVue (#16231)
Browse files Browse the repository at this point in the history
  • Loading branch information
jf-m committed Dec 10, 2022
1 parent 420af68 commit 6a6c710
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/vuetify/src/services/goto/util.ts
Expand Up @@ -42,7 +42,7 @@ function type (el: any) {
function $ (el: any): HTMLElement | null {
if (typeof el === 'string') {
return document.querySelector<HTMLElement>(el)
} else if (el && el._isVue) {
} else if (el && el.__isVue) {
return (el as Vue).$el as HTMLElement
} else if (el instanceof HTMLElement) {
return el
Expand Down
4 changes: 2 additions & 2 deletions packages/vuetify/src/util/__tests__/console.spec.ts
Expand Up @@ -6,15 +6,15 @@ describe('console', () => {
consoleWarn('foo')
expect('[Vuetify] foo').toHaveBeenTipped()

consoleWarn('bar', { _isVue: true, $options: { name: 'baz' } })
consoleWarn('bar', { __isVue: true, $options: { name: 'baz' } })
expect('[Vuetify] bar\n\n(found in <Baz>)').toHaveBeenTipped()
})

it('should generate an error', () => {
consoleError('foo')
expect('[Vuetify] foo').toHaveBeenWarned()

consoleError('bar', { _isVue: true, $options: { name: 'baz' } })
consoleError('bar', { __isVue: true, $options: { name: 'baz' } })
expect('[Vuetify] bar\n\n(found in <Baz>)').toHaveBeenWarned()
})
})
6 changes: 3 additions & 3 deletions packages/vuetify/src/util/console.ts
Expand Up @@ -6,7 +6,7 @@ function createMessage (message: string, vm?: any, parent?: any): string | void

if (parent) {
vm = {
_isVue: true,
__isVue: true,
$parent: parent,
$options: vm,
}
Expand Down Expand Up @@ -64,7 +64,7 @@ function formatComponentName (vm: any, includeFile?: boolean): string {
}
const options = typeof vm === 'function' && vm.cid != null
? vm.options
: vm._isVue
: vm.__isVue
? vm.$options || vm.constructor.options
: vm || {}
let name = options.name || options._componentTag
Expand All @@ -81,7 +81,7 @@ function formatComponentName (vm: any, includeFile?: boolean): string {
}

function generateComponentTrace (vm: any): string {
if (vm._isVue && vm.$parent) {
if (vm.__isVue && vm.$parent) {
const tree: any[] = []
let currentRecursiveSequence = 0
while (vm) {
Expand Down

0 comments on commit 6a6c710

Please sign in to comment.