<a>
组件定义了指向某个页面的一个超链接. 此组件的作用和用法与HTML5中的 <a>
非常类似,区别在于 Weex 的 <a>
组件不能直接在里面添加文本(字符串),如果要展示文本,应该添加 <text>
组件。
此组件支持除了自己外的所有 Weex 组件作为子组件。
href {string}
:定义了超链接的 URL。<a>
支持所有通用样式。
flexbox
布局position
opacity
background-color
查看 组件通用样式。
<a>
支持所有通用事件。
click
**注意:**我们不能保证 click
事件和 href
跳转的执行顺序。建议不要使用 click
事件来处理 href
跳转前的逻辑处理。longpress
appear
disappear
查看 通用事件。
不能直接在 <a>
中添加文本。
请不要为 <a>
添加 click
事件。我们不能确保 click
事件和 href
跳转的执行顺序。
<template> <div class="wrapper"> <a class="button" href="http://dotwe.org/raw/dist/3e0e40f9ddad79f98cd236753965ffd8.js"> <text class="text">Jump</text> </a> </div> </template> <style scoped> .wrapper { flex-direction: column; justify-content: center; } .button { width: 450px; margin-top: 30px; margin-left: 150px; padding-top: 20px; padding-bottom: 20px; border-width: 2px; border-style: solid; border-color: #DDDDDD; background-color: #F5F5F5 } .text { font-size: 60px; color: #666666; text-align: center; } </style>