<a>

<a> 是一个用于实现页面间的跳转或关闭的组件。

子组件

不可以在标签内部直接添加文本,需要使用 <text> 标签来显示文本。

示例代码

  1. <template>
  2. <div class="wrapper">
  3. <a class="button" href="http://g.tbcdn.cn/amte-fe/amte-resource/0.0.8/fast/show_1.js">
  4. <text class="text">去主会场</text>
  5. </a>
  6. <a class="button" href="-1">
  7. <text class="text">关闭</text>
  8. </a>
  9. </div>
  10. </template>
  11. <style scoped>
  12. .wrapper {
  13. align-items: center;
  14. justify-content: center;
  15. }
  16. .button {
  17. width: 350px;
  18. padding-top: 20px;
  19. padding-bottom: 20px;
  20. border-radius: 5px;
  21. background-color: #3eaf7c;
  22. margin-top: 20px;
  23. margin-bottom: 20px;
  24. }
  25. .text {
  26. font-size: 48px;
  27. color: #fff;
  28. text-align: center;
  29. }
  30. </style>

配置参数

属性名 类型 描述 默认值
href String 待跳转的页面 URL,-1为关闭当前页面
可使用 root:// 表示 src 目录,比如首页: root://pages/index.js
-
statusBarColor String 状态栏颜色值 继承 > #3EB4FF
backgroundColor String 页面背景颜色 继承 > #ffffff
更多参数详见 eeui.openPage 的 params 参数说明

例如:

  1. <a
  2. href="http://.../xxx.js"
  3. statusBarColor="#ff0000"><text>红色导航栏</text></a>