【问题标题】:How can I share a custom url into a social media button in vue?如何将自定义 url 共享到 vue 中的社交媒体按钮中?
【发布时间】:2021-05-26 13:22:32
【问题描述】:

我想通过我网站上的社交媒体按钮(比如说表单 url)分享特定的 url,但不能让它工作,只有 whatsapp 分享。我正在使用 vue2 并在语言环境上运行。我的主要问题是它共享我的 localhost url,而不是我的自定义 url。目前我正在使用以下按钮设计:

<head>
<a
      href="https://wa.me/5211234567890?text=Me%20gustaría%20saber%20el%20precio%20del%20coche"
      class="whatsapp"
      target="_blank"
    >
      <i class="fa fa-whatsapp whatsapp-icon"></i
    ></a>
  </head>
  <body>
    <a href="#" class="fa fa-facebook"></a>
    <a href="#" class="fa fa-twitter"></a>
    <a href="#" class="fa fa-linkedin"></a>
    <a href="#" class="fa fa-youtube"></a>
    <a href="#" class="fa fa-instagram"></a>
    <a href="#" class="fa fa-skype"></a>
</body>

<style>
 .whatsapp-icon {
    margin-top: 13px;
  }

  .fa {
    padding: 10px;
    font-size: 30px;
    width: 50px;
    text-align: center;
    text-decoration: none;
    margin: 5px 2px;
  }

  .fa:hover {
    opacity: 0.7;
  }

  .fa-facebook {
    background: #3b5998;
    color: white;
  }

  .fa-twitter {
    background: #55acee;
    color: white;
  }

  .fa-linkedin {
    background: #007bb5;
    color: white;
  }

  .fa-instagram {
    background: #125688;
    color: white;
  }

  .fa-skype {
    background: #00aff0;
    color: white;
  }
</style>

【问题讨论】:

    标签: html vue.js url media social


    【解决方案1】:

    您必须将# 更改为href="#",还需要将https://url 替换为#

    举个例子

    <a href="https://facebook.com/your-name" target="_blank"><i class="fa fa-facebook facebook-icon"></i></a>
    

    【讨论】:

      猜你喜欢
      • 2017-08-21
      • 1970-01-01
      • 2011-10-30
      • 1970-01-01
      • 1970-01-01
      • 2012-08-19
      • 2016-07-22
      • 2016-10-14
      • 2023-03-11
      相关资源
      最近更新 更多