<template>
    <div class="el-edit-tip">
        <slot></slot>
        <span class="edit_text" @click="handleClick">编辑</span>
    </div>
</template>

<script>
export default {
    name: "su-content-edit-tip",
    methods: {
        handleClick () {
            this.$emit('edit')
        }
    }
}
</script>

<style lang="less" scoped>
.el-edit-tip {
    display: inline-block;
    border: 1px solid transparent;
    position: relative;

    &:hover {
        border: 1px dashed #1890ff;

        .edit_text {
            display: inline-block;
        }
    }

    .edit_text {
        padding: 0 3px;
        line-height: 16px;
        opacity: 0.8;
        background: #1890ff;
        border-radius: 2px;
        font-size: 12px;
        font-family: PingFangSC, PingFangSC-Regular;
        font-weight: 400;
        text-align: center;
        color: #ffffff;
        position: absolute;
        top: -16px;
        right: 0;
        cursor: pointer;
        display: none;
    }
}
</style>
