link.nvue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="page">
  3. <text class="example-info">超链接组件,在小程序内复制url,在app内打开外部浏览器,在h5端打开新网页。</text>
  4. <uni-section title="基本示例" type="line"></uni-section>
  5. <view class="example-body">
  6. <uni-link href="https://uniapp.dcloud.io/" text="https://uniapp.dcloud.io/"></uni-link>
  7. </view>
  8. <uni-section title="自定义样式" type="line"></uni-section>
  9. <view class="example-body">
  10. <uni-link href="https://uniapp.dcloud.io/" text="https://uniapp.dcloud.io/" showUnderLine="false" color="#0000FF"></uni-link>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. components: {},
  17. data() {
  18. return {};
  19. }
  20. };
  21. </script>
  22. <style>
  23. @charset "UTF-8";
  24. /* 头条小程序组件内不能引入字体 */
  25. /* #ifdef MP-TOUTIAO */
  26. @font-face {
  27. font-family: uniicons;
  28. font-weight: normal;
  29. font-style: normal;
  30. src: url("~@/static/uni.ttf") format("truetype");
  31. }
  32. /* #endif */
  33. /* #ifndef APP-NVUE */
  34. page {
  35. display: flex;
  36. flex-direction: column;
  37. box-sizing: border-box;
  38. background-color: #efeff4;
  39. min-height: 100%;
  40. height: auto;
  41. }
  42. view {
  43. font-size: 14px;
  44. line-height: inherit;
  45. }
  46. .example {
  47. padding: 0 15px 15px;
  48. }
  49. .example-info {
  50. padding: 15px;
  51. color: #3b4144;
  52. background: #ffffff;
  53. }
  54. .example-body {
  55. /* #ifndef APP-NVUE */
  56. display: flex;
  57. /* #endif */
  58. flex-direction: row;
  59. flex-wrap: wrap;
  60. justify-content: center;
  61. padding: 0;
  62. font-size: 14px;
  63. background-color: #ffffff;
  64. }
  65. /* #endif */
  66. .example {
  67. padding: 0 15px;
  68. }
  69. .example-info {
  70. /* #ifndef APP-NVUE */
  71. display: block;
  72. /* #endif */
  73. padding: 15px;
  74. color: #3b4144;
  75. background-color: #ffffff;
  76. font-size: 14px;
  77. line-height: 20px;
  78. }
  79. .example-info-text {
  80. font-size: 14px;
  81. line-height: 20px;
  82. color: #3b4144;
  83. }
  84. .example-body {
  85. flex-direction: column;
  86. padding: 15px;
  87. background-color: #ffffff;
  88. }
  89. .word-btn-white {
  90. font-size: 18px;
  91. color: #FFFFFF;
  92. }
  93. .word-btn {
  94. /* #ifndef APP-NVUE */
  95. display: flex;
  96. /* #endif */
  97. flex-direction: row;
  98. align-items: center;
  99. justify-content: center;
  100. border-radius: 6px;
  101. height: 48px;
  102. margin: 15px;
  103. background-color: #007AFF;
  104. }
  105. .word-btn--hover {
  106. background-color: #4ca2ff;
  107. }
  108. .example-body {
  109. flex-direction: row;
  110. justify-content: flex-start;
  111. }
  112. </style>