All files / lib/components tooltip.vue

63.64% Statements 7/11
50% Branches 3/6
100% Functions 3/3
63.64% Lines 7/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 4218x 18x 18x   18x 18x                     18x     18x                                            
<template>
    <div class="d-inline-block">
    I    <span class="d-inline-block" ref="trigger"><slot></slot></span>
        <div :class="['tooltip','tooltip-' + this.placement]"
           E  :style="{opacity:showState?1:0}"
             tabindex="-1"
             ref="popover"
             @focus="$emit('focus')"
             @blur="$emit('blur')"
        >
            <div class="tooltip-inner">
                <slot name="content"><span v-html="content"></span></slot>
            </div>
        </div>
    </div>
</template>
 
<style>
    .tooltip {
        display: block;
        transition: all 0.3s;
    }
</style>
 
<script>
    import { popoverMixin } from '../mixins';
 
    export default {
        mixins: [popoverMixin],
        props: {
            content: {
                type: String,
                default: ''
            },
            triggers: {
                type: [Boolean, String, Array],
                default: 'hover'
            }
        }
    };
</script>