添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

<a>

Updated time: 14/06/2017

<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 跳转的执行顺序。

    示例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    <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>

    Try it

    Share
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    > 区块引用
    下一行

    或者:
    {% blockquote %}
    普通的引用
    下一行
    {% endblockquote %}

    嵌套引用
    > 一层
    >> 两层

    区块引用
    下一行

    普通的引用
    下一行

    1
    2
    3
    4
    虚线:
    ***
    或者(实线)
    ---
    1
    2
    [这是一个绝对路径的链接](https://hexo.io/zh-cn/docs/writing.html)
    [这是一个相对路径的链接](/2017/08/07/hello-world/)

    这是一个绝对路径的链接
    这是一个相对路径的链接

    1
    2
    **双星加粗**
    __双下划线加粗__

    双星加粗
    双下划线加粗

    1
    2
    *星号斜体*
    _下划线斜体_

    星号斜体
    下划线斜体

  • 删除线
    1
    ~~删除线~~
    1
    2
    3
    4
    5
    ![图1. 我最爱的炮兵](/assert/img.jpg "Title")

    {% img [class names] /path/to/image [width] [height] [title text [alt text]] %}

    {% img [box-model] http://weex.apache.org/cn/references/images/css-boxmodel.png 377 340 weex 盒模型 %}


    1
    2
    3
    多行代码块使用三个`
    单行代码使用一个`
    console.log('hello world!')

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    方法1: - 和 = (任何数量等效)
    一级标题
    ===
    二级标题
    ---

    方法2: #
    # 一级 H1
    ## 二级 H2
    ### 三级 H3
    #### 四级 H4
    ##### 五级 H5
    ###### 六级 H6

    方法1: - 和 =

    一级标题

    二级标题

    方法2: #

    一级

    二级

    三级

    四级

    五级
    六级
    1. jsfiddle

      1
      2
      3
      {% jsfiddle shorttag [tabs] [skin] [width] [height] %}

      {% jsfiddle stardew/ffnm6Lsd/1/ %} 点击左上角fiddles
    2. link

      1
      2
      3
      {% link text url [external] [title] %}

      你好,我是{% link 百度 https://www.baidu.com/ 搜索 度娘 %}.
      你好,我是 百度 .
        1
        
        
        
        
            
        
        2
        3
        4
        5
        6
        7
        8
        9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        左中右对齐


        dog | bird | cat
        --- | ---- | ---
        foo | foo | foo
        bar | bar | bar
        baz | baz | baz

        dog | bird | cat
        :---- | :---- | :----
        foo | foo | foo
        bar | bar | bar
        baz | baz | baz

        dog | bird | cat
        :----: | :----: | :----:
        foo | foo | foo
        bar | bar | bar
        baz | baz | baz

        dog | bird | cat
        ----: | ----: | ----:
        foo | foo | foo
        bar | bar | bar
        baz | baz | baz
        1
        2
        3
        4
        5
        6
        7
        8
        {% raw %}
        content
        {% endraw %}

        或者直接
        content

        <span class="color-box" style="background:#FF00FF;color:#FF00FF"> yy </span> #FF00FF

        yy #FF00FF

        Path (英) v0.9+

        Updated time: 14/06/2017

        本文将介绍 Weex 中 uri(url) 的用法。包括使用图像、字体等资源,处理相对路径以及如何访问本地及打包的资源文件。

        Schemes

  •