提取 vc-tooltip

pull/165/head
wangxueliang 2018-03-14 14:28:54 +08:00
parent d38b1bc595
commit d86384a923
6 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
<script> <script>
import { cloneElement } from '../_util/vnode' import { cloneElement } from '../_util/vnode'
import RcTooltip from './src/Tooltip' import VcTooltip from '../vc-tooltip'
import getPlacements from './placements' import getPlacements from './placements'
import PropTypes from '../_util/vue-types' import PropTypes from '../_util/vue-types'
import { hasProp, getComponentFromProp, getClass, getStyle, isValidElement } from '../_util/props-util' import { hasProp, getComponentFromProp, getClass, getStyle, isValidElement } from '../_util/props-util'
@ -175,12 +175,12 @@ export default {
}, },
} }
return ( return (
<RcTooltip {...tooltipProps}> <VcTooltip {...tooltipProps}>
<template slot='overlay'> <template slot='overlay'>
{getComponentFromProp(this, 'title')} {getComponentFromProp(this, 'title')}
</template> </template>
{sVisible ? cloneElement(child, { class: childCls }) : child} {sVisible ? cloneElement(child, { class: childCls }) : child}
</RcTooltip> </VcTooltip>
) )
}, },
} }

View File

@ -1,8 +1,8 @@
<script> <script>
import PropTypes from '../../_util/vue-types' import PropTypes from '../_util/vue-types'
import Trigger from '../../trigger' import Trigger from '../trigger'
import { placements } from './placements' import { placements } from './placements'
import { hasProp, getComponentFromProp } from '../../_util/props-util' import { hasProp, getComponentFromProp } from '../_util/props-util'
function noop () {} function noop () {}
export default { export default {
props: { props: {