-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from alibaba/doc
Doc
- Loading branch information
Showing
17 changed files
with
444 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# <a> | ||
###Summary | ||
<a> defines a hyperlink to a page in the web. Its purpose and syntax is very simliar to [<a>](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) in HTML5. | ||
|
||
### Child Components | ||
|
||
This type of component supports all kinds of weex component as its child components except for its own kind. | ||
|
||
### Attributes | ||
##### href | ||
href attributes defines the URL of the hyperlink. | ||
|
||
### Styles | ||
**common styles**: check out the [common styles](../references/common-attrs.md) | ||
|
||
### Events | ||
**common events**: check out the [common events](../references/common-event.md) | ||
|
||
### Examples | ||
<a href="http://g.tbcdn.cn/ali-wireless-h5/res/0.0.16/hello.js"> | ||
<text>Click me to see how 'A' element opens a new world.</text> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# <web> | ||
|
||
### Summary | ||
|
||
Use <web> component to display any web content in the weex page. The `src` attribute can be used to specify a special web source. You also could use `webview` module to control the operation of web such as goBack、goForward and reload, see [webview module](../modules/webview.md). | ||
|
||
|
||
### Child Components | ||
|
||
This component supports no child components. | ||
|
||
### Attributes | ||
|
||
- `src`: <string> the attribute value specifies a special website you want to display. | ||
|
||
Other attributes please check out the [common attributes](../references/common-attrs.md). | ||
|
||
### Styles | ||
|
||
- `width`: <length> the width of the component. This style should be specified. | ||
- `height`: <length> the height of the component. This style should be specifed. | ||
|
||
**common styles**: check out the [common styles](../references/common-attrs.md) | ||
|
||
- support flexbox related styles | ||
- support box model related styles | ||
- support ``position`` related styles | ||
|
||
### Events | ||
|
||
- `pagestart`: sent after the web component starts loading a frame. | ||
- `pagefinish`: sent after the web component finishes loading a frame. | ||
- `error`: sent if the web component failed to load a frame. | ||
|
||
|
||
*common events**: check out the [common events](../references/common-event.md) | ||
|
||
- support `click` event. Check out [common events](../references/common-event.md) | ||
- support `appear` / `disappear` event. Check out [common events](../references/common-event.md) | ||
|
||
### Example | ||
|
||
```js | ||
<div> | ||
<web style="width=...; height=...;" src="..." onpagestart="pagestart" onpagefinish="pagefinish" onerror="error"> | ||
</web> | ||
</div> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# <wxc-navpage> | ||
|
||
### Summary | ||
|
||
The "wxc-navpage" tag implements a specialized component that contains a navbar at the top of the window and an embed content page. You can customize the navbar as you like. In addition, you can use `navigator` module to control the page jump, see [navigator module](../modules/navigator.md). | ||
|
||
### Child Components | ||
|
||
This type of component supports all kinds of weex component as its child components. | ||
|
||
### Attributes | ||
|
||
- `height`: <length> The height of the navbar. Default value is 88. | ||
- `background-color`: <color>The backgroudColor of the navbar. Default value is `white`. | ||
- `title`: <string> The title of the navbar. | ||
- `title-color`: <color>The color of the navbar title. Default value is `black`. | ||
- `left-item-title`: <string> The title of the leftItem. | ||
- `left-item-color`: <color> The color of the leftItem title. Default value is `black`. | ||
- `right-item-title`: <string> The title of the rightItem. | ||
- `right-item-color`: <color> The color of the rightItem title. Default value is `black`. | ||
- `left-item-src`: <string> The imageURL of the leftItem you want to set. | ||
- `right-item-src`: <string> The imageURL of the rightItem you want to set. | ||
|
||
Other attributes please check out the [common attributes](../references/common-attrs.md). | ||
|
||
### Styles | ||
|
||
**common styles**: check out the [common styles](../references/common-attrs.md) | ||
|
||
- support flexbox related styles | ||
- support box model related styles | ||
- support ``position`` related styles | ||
- support ``opacity``, ``background-color`` etc. | ||
|
||
### Events | ||
|
||
- `naviBar.leftItem.click`: triggered when the leftItem of navbar is clicked. You need to register the observer in ready or create block. | ||
- `naviBar.rightItem.click`: triggered when the rightItem of navbar is clicked. You need to register the observer in ready or create block. | ||
|
||
**common events**: check out the [common events](../references/common-event.md) | ||
|
||
- support `click` event. Check out [common events](../references/common-event.md) | ||
- support `appear` / `disappear` event. Check out [common events](../references/common-event.md) | ||
|
||
### Example | ||
|
||
```js | ||
<template> | ||
<wxc-navpage height={{...}} background-color="..." title="..." title-color="..." left-item-title="..." left-item-color="..." right-item-src="..."> | ||
<content> ...</content> | ||
</wxc-navpage> | ||
</template> | ||
<script> | ||
require('weex-components'); | ||
module.exports = { | ||
created: function() { | ||
this.$on('naviBar.rightItem.click',function(e){ | ||
//handle your click event here. | ||
}); | ||
|
||
this.$on('naviBar.leftItem.click',function(e){ | ||
//handle your click event here. | ||
}); | ||
} | ||
} | ||
</script> | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# <wxc-tabbar> | ||
|
||
### Summary | ||
|
||
The "wxc-tabbar" tag implements a specialized component that corresponds to the radio-style selection. It displays tabs at the bottom of the window for selecting between the different modes and for displaying different weex pages for that mode. | ||
|
||
### Child Components | ||
|
||
This component supports no child components. | ||
|
||
### Attributes | ||
|
||
- `tab-items`: This attribute contains an array of tabitem objects, each of which corresponds to a tab displayed by the tabbar. The order of the items in this attribute corresponds to the order of the items onscreen. You can customize the appearance of tabbar by setting tabitem. The properties of each tabitem describe as follows. | ||
+ index: <integer> an integer that you can use to identify item objects. | ||
+ title: <string> The item’s title. If null, a title is not displayed. | ||
+ titleColor: <color>The item’s titleColor. Default is black color. | ||
+ image: <string>The icon displayed when the tabitem is unselected. If null, the icon is not displayed. | ||
+ selectedImage: <string>The icon displayed when the tabitem is selected. If null, the icon is not displayed. | ||
+ src: <string>The custom weex page to display. | ||
+ icon: <string>This is a special attribute. Be careful, You need to set the property even if it is empty. | ||
|
||
Other attributes please check out the [common attributes](../references/common-attrs.md). | ||
|
||
### Styles | ||
|
||
**common styles**: check out [common styles for components](../references/common-style.md) | ||
|
||
- support flexbox related styles | ||
- support box model related styles | ||
- support ``position`` related styles | ||
- support ``opacity``, ``background-color`` etc. | ||
|
||
### Events | ||
|
||
- `tabBar.onClick`: triggered when the tabitem is selected. You need to register the observer in ready or create block. | ||
|
||
### Example | ||
|
||
`require('weex-components')` should be used with webpack, see [example](https://github.com/alibaba/weex/blob/example/examples/component/tabbar/tabbar-demo.we) for more detail. | ||
|
||
```html | ||
<template> | ||
<div style="flex-direction: column;"> | ||
<wxc-tabbar tab-items = {{tabItems}}></wxc-tabbar> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
require('weex-components'); | ||
module.exports = { | ||
data: { | ||
tabItems: [ | ||
{ | ||
index: 0, | ||
title: '...', | ||
titleColor: '#000000', | ||
icon: '', | ||
image: '...', | ||
selectedImage: '...', | ||
src: '...', | ||
visibility: 'visible', | ||
}, | ||
{ | ||
index: 1, | ||
title: '...', | ||
titleColor: '#000000', | ||
icon: '', | ||
image: '...', | ||
selectedImage: '...', | ||
src: '...', | ||
visibility: 'hidden', | ||
} | ||
], | ||
}, | ||
methods: { | ||
ready: function (e) { | ||
var vm = this; | ||
vm.$on('tabBar.onClick',function(e){ | ||
var index = e.detail.index; | ||
.... | ||
}); | ||
}, | ||
} | ||
} | ||
</script> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Samples | ||
# Examples | ||
|
||
* [Hello World](./hello-world.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.