赞
踩
特性:
- 显示复制图标
- 支持复制链接
- 支持跳转链接
- 移入链接颜色高亮出现底部下划线
- <template>
- <div :class="$options.name">
- <el-link
- icon="el-icon-copy-document"
- :underline="false"
- type="primary"
- @click.stop="$g.copy(data.link, true)"
- :title="`复制链接`"
- />
- <el-tooltip
- :content="data.link"
- :effect="`dark`"
- :enterable="false"
- :placement="`top`"
- :popper-class="`${$options.name}-el-tooltip`"
- :transition="`none`"
- >
- <span class="link" @click.stop="go(data.link)">
- {{ data.link }}
- </span>
- </el-tooltip>
- </div>
- </template>
- <script>
- export default {
- name: "sgLinkText",
- components: {},
- data() {
- return {};
- },
- props: ["data"],
- computed: {},
- watch: {},
- created() {},
- mounted() {},
- destroyed() {},
- methods: {
- go(link) {
- window.open(link, "_blank");
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .sgLinkText {
- /*单行省略号*/
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- .link {
- color: #409eff;
- cursor: pointer;
- box-sizing: border-box;
- border-bottom: 1px solid transparent;
- // transition: 0.382s;
- &:hover {
- color: #66b1ff;
- border-color: currentColor;
- }
- }
- }
- </style>
<sgLinkText :data="{ link: `http://www.shuzhiqiang.com` }" />
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。