Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Update website #16

Merged
merged 4 commits into from
Mar 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions doc/source/cn/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Weex 是一套简单易用的跨平台开发方案,能以 web 的开发体验

## Vue 是什么?

Vue.js 是 Evan You 开发的渐进式 JavaScript 框架,在易用性、灵活性和性能等方面都非常优秀。开发者能够通过撰写 `*.vue` 文件,基于 `<template>`, `<style>`, `<script>` 快速构建组件化的 web 应用。
Vue.js 是 Evan You 开发的渐进式 JavaScript 框架。开发者能够通过撰写 `*.vue` 文件,基于 `<template>`, `<style>`, `<script>` 快速构建组件化的 web 应用。

## Hello World

Expand All @@ -21,13 +21,44 @@ Vue.js 是 Evan You 开发的渐进式 JavaScript 框架,在易用性、灵活
- 为你的手机安装 [Playground App](https://alibaba.github.io/weex/download.html),当然,Weex 是跨平台的框架,你依然可以使用浏览器进行预览,只是这样你就无法感受到 native 优秀的体验了。
- 在新标签页中打开 [Hello World](http://dotwe.org/vue/4d5a0471ece3daabd4681bc6d703c4c1) 例子,点击预览,然后用 Playground 扫码即可。

在这个例子中,我们看到了熟悉的 HTML 语义化标签、CSS 样式和 Javascript 代码。这是一个最简单的 Weex 示例,它在页面中渲染了一个 “Hello World”。请注意,这不是一个 H5 页面,而是 native 的。

![mobile_preview](https://img.alicdn.com/tps/TB1Ymw3OpXXXXcvXpXXXXXXXXXX-500-1013.jpg)

很简单,我们可以看到语法就是我们熟悉的 Vue。你可以修改这个例子,再次扫码尝试。
### 发生了什么?

就如示例代码所示:

```html
<template>
<div>
<text class="text">{{text}}</text>
</div>
</template>

<style>
.text {
font-size: 50;
}
</style>

<script>
export default {
data () {
return {
text: 'Hello World.'
}
}
}
</script>
```

我们暂时不去关心 Weex 的技术细节,仅看大致的代码结构,我们可以看到语法就是我们熟悉的 Vue。你可以修改这个例子,再次扫码尝试。

## 搭建开发环境

使用 dotWe 对 Weex 尝鲜是一个不错的选择,但如果你想更专业的开发 Weex, dotWe 就不怎么够用了。本节会教你如何搭建本地开发环境进行 Weex 开发。

### 第一步:安装依赖

Weex 官方提供了 weex-toolkit 的脚手架工具来辅助开发和调试。首先,你需要 Node.js 和 weex-toolkit。
Expand Down
8 changes: 4 additions & 4 deletions doc/source/cn/references/components/a.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ version: 2.1

## 约束

1. **不能**直接在 `<a>` 中添加文本。
- **不能**直接在 `<a>` 中添加文本。
错误示例,“click” 无法被正常渲染。

```html
Expand All @@ -62,9 +62,9 @@ version: 2.1
</style>
```

[体验一下](http://dotwe.org/0a22d65138691a208e3fb1f8f6392b38)
[体验一下](http://dotwe.org/0a22d65138691a208e3fb1f8f6392b38)

2. 请不要为 `<a>` 添加 `click` 事件。我们不能确保 `click` 事件和 `href` 跳转的执行顺序。
- 请不要为 `<a>` 添加 `click` 事件。我们不能确保 `click` 事件和 `href` 跳转的执行顺序。

## 示例

Expand Down Expand Up @@ -101,4 +101,4 @@ version: 2.1
</style>
```

[try it](../../../examples/a.html)
[try it](http://dotwe.org/vue/025db54e37123ab5336a4b848397660f)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/cell.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ version: 2.1
</style>
```

[try it](../../../examples/list.html)
[try it](http://dotwe.org/vue/d31c85e7cd2dc54fa098e920a5376c38)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/div.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ version: 2.1
</style>
```

[try it](../../../examples/div.html)
[try it](http://dotwe.org/vue/edfbd1806508cb86254b03dc0b8e28ac)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@ version: 2.1
</style>
```

[try it](../../../examples/image.html)
[try it](http://dotwe.org/vue/e2122bc245beafb0348d79bfd1274904)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/indicator.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ version: 2.1
</script>
```

[try it](../../../examples/indicator.html)
[try it](http://dotwe.org/vue/d2a654c4b75f1b4d80336c8a5fe133b9)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ Weex 内置的 `<input>` 组件用来创建接收用户输入字符的输入组
</style>
```

[try it](../../../examples/input.html)
[try it](http://dotwe.org/vue/c1b1a5fdcf0937df1d847f8812a7ccb2)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ version: 2.1
</style>
```

[try it](../../../examples/list.html)
[try it](http://dotwe.org/vue/d31c85e7cd2dc54fa098e920a5376c38)
2 changes: 2 additions & 0 deletions doc/source/cn/references/components/loading.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,5 @@ version: 2.1
}
</style>
```

[Try it](http://dotwe.org/vue/d5c1b2336a703a6e6e47c303af41ffcd)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/refresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ version: 2.1
</style>
```

[try it](../../../examples/refresh.html)
[try it](http://dotwe.org/vue/d3db5f344220a6339de044a5e33c502b)

更多示例可查看 [`<list>`](./list.html)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/scroller.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,4 @@ version: 2.1
</style>
```

[try it](../../../examples/scroller.html)
[try it](http://dotwe.org/vue/2f22f14fb711d88515e63c3f67bed46a)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ version: 2.1
</script>
```

[try it](../../../examples/slider.html)
[try it](http://dotwe.org/vue/0c43ffd743c90b3bd9f5371062652e60)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ version: 2.1
</style>
```

[try it](../../../examples/switch.html)
[try it](http://dotwe.org/vue/06b1d740fb69d04f9ebe9eaf730974d1)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ version: 2.1
</style>
```

[try it](../../../examples/text.html)
[try it](http://dotwe.org/vue/154e20171d350a081fba7878c53cf7d2)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/textarea.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,4 @@ version: 2.1
</style>
```

[try it](../../../examples/textarea.html)
[try it](http://dotwe.org/vue/a1877866e8b91ffa1e6ea9bc66c200fa)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ version: 2.1
</script>
```

[try it](../../../examples/video.html)
[try it](http://dotwe.org/vue/01d3d27073a471bb234b1a76e130d197)
2 changes: 1 addition & 1 deletion doc/source/cn/references/components/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ version: 2.1
</style>
```

[try it](../../../examples/web.html)
[try it](http://dotwe.org/vue/154c7fa8ac13e87ff4e7bf9862147d50)
2 changes: 1 addition & 1 deletion doc/source/cn/references/modules/animation.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ version: 2.1
</style>
```

[try it](../../../examples/animation.html)
[try it](http://dotwe.org/vue/2d1b61bef061448c1a5a13eac9624410)
2 changes: 1 addition & 1 deletion doc/source/cn/references/modules/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ version: 2.1
</style>
```

[try it](../../../examples/clipboard.html)
[try it](http://dotwe.org/vue/126d3cfc5533393e28943978b07aa5c1)
4 changes: 2 additions & 2 deletions doc/source/cn/references/modules/dom.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ version: 2.1
</style>
```

[try it](../../../examples/dom-scroll.html)
[try it](http://dotwe.org/vue/56e0d256cbb26facd958dbd6424f42b2)

### getComponentRect(ref, callback) <span class="api-version">v0.9.4+</span>

Expand Down Expand Up @@ -203,7 +203,7 @@ version: 2.1
</style>
```

[try it](../../../examples/dom-rect.html)
[try it](http://dotwe.org/vue/87d4ed571de129ab28052b06a5d65fc8)

## 其他

Expand Down
31 changes: 11 additions & 20 deletions doc/source/cn/references/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,14 @@ version: 2.1

# 内建模块

## 如何使用

你可以简单的通过类似 `weex.requireModule('name')` 这样的语法获取一个模块的 API,比如:

```html
<script>
const modal = weex.requireModule('modal')

module.exports = {
data: {},
methods: {
toast: function () {
modal.toast({
message: 'props: ' + event.data.join(', ')
})
}
}
}
</script>
```
- [animation](./animation.html)
- [WebSocket](./websocket.html)
- [picker](./picker.html)
- [clipboard](./clipboard.html)
- [dom](./dom.html)
- [modal](./modal.html)
- [navigator](./navigator.html)
- [storage](./storage.html)
- [stream](./stream.html)
- [webview](./webview.html)
- [globalEvent](./globalevent.html)
2 changes: 1 addition & 1 deletion doc/source/cn/references/modules/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ version: 2.1
</style>
```

[try it](../../../examples/modal.html)
[try it](http://dotwe.org/vue/a7dddfb24edb72be947fc4eec3803f1d)
2 changes: 1 addition & 1 deletion doc/source/cn/references/modules/navigator.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ version: 2.1
</style>
```

[try it](../../../examples/navigator.html)
[try it](http://dotwe.org/vue/5c670b07735ee6d08de5c8eb93f91f11)
2 changes: 1 addition & 1 deletion doc/source/cn/references/modules/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ version: 2.1
</style>
```

[try it](../../../examples/storage.html)
[try it](http://dotwe.org/vue/3fdd3e2d1646ca41199d80c7be799858)

## 其它参考

Expand Down
2 changes: 1 addition & 1 deletion doc/source/cn/references/modules/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ version: 2.1
</style>
```

[try it](../../../examples/stream.html)
[try it](http://dotwe.org/vue/29bbf2d49fc8a204f98240044bbe211a)
Loading