|
|
@@ -1,69 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="tooltip-wrapper" :style="{left: frameCenterPos}">
|
|
|
- <div class="arrow" :style="{left: arrowCenterPos}"></div>
|
|
|
- <div class="remark">{{text}}</div>
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-export default {
|
|
|
- props: {
|
|
|
- text: {
|
|
|
- type: String,
|
|
|
- default: '测试test测试test',
|
|
|
- },
|
|
|
- frameCenterPos: {
|
|
|
- type: String,
|
|
|
- default: '50%',
|
|
|
- },
|
|
|
- arrowCenterPos: {
|
|
|
- type: String,
|
|
|
- default: '50%',
|
|
|
- }
|
|
|
- },
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
-@arrow-height: 6px;
|
|
|
-@border-width: 1px;
|
|
|
-@extra-transform-y: 5px;
|
|
|
-.tooltip-wrapper {
|
|
|
- position: absolute;
|
|
|
- // left: 50%;
|
|
|
- transform: translateX(-50%) translateY(calc(-100% - @arrow-height - @border-width - @border-width - @extra-transform-y));
|
|
|
- top: 0;
|
|
|
- z-index: 10000;
|
|
|
- display: none;
|
|
|
-
|
|
|
- background: #191A1C;
|
|
|
- border: @border-width solid rgba(151, 151, 151, 0.2);
|
|
|
- border-radius: 3px;
|
|
|
- box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
|
|
|
- padding: 8px 8px;
|
|
|
- cursor: default;
|
|
|
- pointer-events: none;
|
|
|
- word-break: keep-all;
|
|
|
- font-size: 12px;
|
|
|
- .arrow {
|
|
|
- width: 12px;
|
|
|
- height: 12px;
|
|
|
-
|
|
|
- position: absolute;
|
|
|
- // left: 50%;
|
|
|
- transform: translateX(-50%) rotate(45deg);
|
|
|
- bottom: -@arrow-height;
|
|
|
-
|
|
|
- box-sizing: border-box;
|
|
|
- border: @border-width solid transparent;
|
|
|
- border-right: @border-width solid rgba(151, 151, 151, 0.2);
|
|
|
- border-bottom: @border-width solid rgba(151, 151, 151, 0.2);
|
|
|
- background: #191A1C;
|
|
|
- }
|
|
|
- .remark {
|
|
|
- line-height: 17px;
|
|
|
- color: rgba(255, 255, 255, 0.6);
|
|
|
- white-space: pre;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|