Skip to content

Commit

Permalink
fix: use parent refs instead of componentInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
KaelWD committed Jun 26, 2018
1 parent 3fa610f commit fe1bff7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/components/VBottomSheet/VBottomSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import VDialog from '../VDialog/VDialog'

/* @vue/component */
export default {
functional: true,

name: 'v-bottom-sheet',

functional: true,

props: {
disabled: Boolean,
fullWidth: Boolean,
Expand Down
8 changes: 7 additions & 1 deletion src/components/VDialog/VDialog.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import VDialogContent from './VDialogContent'

let counter = 0

/* @vue/component */
export default {
name: 'v-dialog',
Expand All @@ -12,13 +14,17 @@ export default {
const slots = context.slots()
const activator = slots.activator && slots.activator[0]

context.data.ref = context.data.ref || '$_v-dialog-' + counter++

const content = h(VDialogContent, context.data, slots.default)

if (activator) {
activator.data.on = activator.data.on || {}
activator.data.on.click = e => {
console.log(context.parent.$refs)
e.preventDefault()
if (!content.componentInstance.disabled) content.componentInstance.isActive = true
const dialog = context.parent.$refs[context.data.ref]
if (!dialog.disabled) dialog.isActive = true
}
}

Expand Down

0 comments on commit fe1bff7

Please sign in to comment.