显示一个外部链接的组件

<template>
  <component :is="type" v-bind="linkProps(to)">
    213123123123
  </component>
</template>

<script>

export default {

  data() {
    return {
      type: 'a',
      to: "https://www.qq.com"
    }
  },
  methods: {
    linkProps(to) {
      return {
        href: to,
        target: '_blank',
        rel: 'noopener'
      }
      return {
        to: to
      }
    }
  }
}
</script>

相关文章:

  • 2022-12-23
  • 2021-11-20
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-07
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案