From 37f8040a6ebfa3dd4a7314e3c4869f6ea19bf99e Mon Sep 17 00:00:00 2001 From: dntzhang Date: Mon, 7 Oct 2019 14:27:51 +0800 Subject: [PATCH] docs: update omi docs --- site/omi-src/src/docs/en/lifecycle.md | 3 +-- site/omi-src/src/docs/en/router.md | 5 ++++- site/omi-src/src/docs/zh-cn/router.md | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/site/omi-src/src/docs/en/lifecycle.md b/site/omi-src/src/docs/en/lifecycle.md index f1ab18996..60ef118cb 100644 --- a/site/omi-src/src/docs/en/lifecycle.md +++ b/site/omi-src/src/docs/en/lifecycle.md @@ -16,14 +16,13 @@ For example: import { render, WeElement, define } from 'omi' define('my-timer', class extends WeElement { - static observe = true - data = { seconds: 0 } tick() { this.data.seconds++ + this.update() } install() { diff --git a/site/omi-src/src/docs/en/router.md b/site/omi-src/src/docs/en/router.md index d7ba0ebad..f40eecde4 100644 --- a/site/omi-src/src/docs/en/router.md +++ b/site/omi-src/src/docs/en/router.md @@ -34,7 +34,6 @@ import './user' import './user-list' define('my-app', class extends WeElement { - static observe = true data = { tag: 'my-home' } @@ -42,20 +41,24 @@ define('my-app', class extends WeElement { route('/', () => { this.data.tag = 'my-home' + this.update() }) route('/about', (evt) => { console.log(evt.query) this.data.tag = 'my-about' + this.update() }) route('/user-list', () => { this.data.tag = 'user-list' + this.update() }) route('/user/:name/category/:category', (evt) => { this.data.tag = 'my-user' this.data.params = evt.params + this.update() }) route('*', function () { diff --git a/site/omi-src/src/docs/zh-cn/router.md b/site/omi-src/src/docs/zh-cn/router.md index e629cda2a..d8140b30f 100644 --- a/site/omi-src/src/docs/zh-cn/router.md +++ b/site/omi-src/src/docs/zh-cn/router.md @@ -34,7 +34,6 @@ import './user' import './user-list' define('my-app', class extends WeElement { - static observe = true data = { tag: 'my-home' } @@ -42,20 +41,24 @@ define('my-app', class extends WeElement { route('/', () => { this.data.tag = 'my-home' + this.update() }) route('/about', (evt) => { console.log(evt.query) this.data.tag = 'my-about' + this.update() }) route('/user-list', () => { this.data.tag = 'user-list' + this.update() }) route('/user/:name/category/:category', (evt) => { this.data.tag = 'my-user' this.data.params = evt.params + this.update() }) route('*', function () {