SiteLink.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <div class="site-link">
  3. <a
  4. v-for="({label, icon, url}, index) in links"
  5. :key="index"
  6. :href="url"
  7. :target="url.indexOf('http') === 0 ? '_blank' : '_self'"
  8. :title="label"
  9. :class="`rt-icon-${icon}`"
  10. />
  11. </div>
  12. </template>
  13. <script>
  14. export default {
  15. name: 'SiteLink',
  16. data () {
  17. return {
  18. links: [{
  19. label: 'GitHub',
  20. icon: 'github',
  21. url: 'https://github.com/bhuh12/vue-router-tab'
  22. }, {
  23. label: '文档和API',
  24. icon: 'api',
  25. url: 'https://bhuh12.github.io/vue-router-tab/'
  26. }, {
  27. label: 'Issues',
  28. icon: 'feedback',
  29. url: 'https://github.com/bhuh12/vue-router-tab/issues'
  30. }, {
  31. label: '作者主页',
  32. icon: 'home',
  33. url: 'https://bhuh.net'
  34. }]
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss" scoped>
  40. .site-link {
  41. display: flex;
  42. justify-content: space-around;
  43. padding: .8em 0;
  44. text-align: center;
  45. a {
  46. font-size: 1.5rem;
  47. color: #888;
  48. text-decoration: none;
  49. transition: all .1s ease;
  50. &:hover,
  51. &:active {
  52. color: $color;
  53. transform: scale(1.2);
  54. }
  55. }
  56. }
  57. </style>