<a>

Summary

<a> is mainly used for navigation between weex pages。

::: tip It's forbidden to add text directly to <a>, use <text> to wrap your text instead. :::

<a href="http://dotwe.org/raw/dist/a5e3760925ac3b9d68a3aa0cc0298857.bundle.wx">
  <text>Jump</text>
</a>

Attributes

  • href String, href defines the URL that current page will navigate to. href must point to a weex page, or behavior is undefined.

Style

Events

::: tip The execution order of callback function of click and href is undefined. Do not use click event to do the preprocessing of href. :::

Vue Example

<a href="http://emas-ha-remote-log-poc.oss-cn-beijing.aliyuncs.com/eweex/app/biz-docs-com-mod/upload/271ccdca-db41-423d-981c-c7c6751ba479/show_1.js">
  <text>主会场</text>
</a> 

Demo

Rax Example

rax-link is the component <a> of rax, which can run in web and weex.

import { createElement, render } from 'rax';
import Driver from "driver-universal";
import Link from 'rax-link';
import Text from 'rax-text';

function App() {
	return <Link href={"//www.google.com"} onPress={(e)=>{console.log(e)}}>
	  <Text>click me</Text>
	</Link>
}

rax-link doc