8000 doc: remove README repeat code · e3d/vue-function-api@13330ad · GitHub
[go: up one dir, main page]

Skip to content

Commit 13330ad

Browse files
ihoeyliximomo
authored andcommitted
doc: remove README repeat code
1 parent 144afac commit 13330ad

File tree

2 files changed

+7
-43
lines changed

2 files changed

+7
-43
lines changed

README.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Future-Oriented Programming, `vue-function-api` provides function api from `Vue3
2828

2929
# Installation
3030

31-
**npm**
31+
**npm**
3232
```bash
3333
npm install vue-function-api --save
3434
```
@@ -162,24 +162,6 @@ const MyComponent = {
162162
}
163163
```
164164

165-
```js
166-
import { value } from 'vue-function-api'
167-
168-
const MyComponent = {
169-
setup(props) {
170-
const msg = value('hello')
171-
const appendName = () => {
172-
msg.value = `hello ${props.name}`
173-
}
174-
return {
175-
msg,
176-
appendName
177-
}
178-
},
179-
template: `<div @click="appendName">{{ msg }}</div>`
180-
}
181-
```
182-
183165
## state
184166
**state**(value: *`any`*)
185167

@@ -217,9 +199,9 @@ console.log(countPlusOne.value) // 2
217199
```
218200

219201
## watch
220-
**watch**(source: *`Wrapper | () => any`*, callback: *`(newVal, oldVal)`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
202+
**watch**(source: *`Wrapper | () => any`*, callback: *`(newVal, oldVal)`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
221203

222-
**watch**(source: *`Array<Wrapper | () => any>`*, callback: *`([newVal1, newVal2, ... newValN], [oldVal1, oldVal2, ... oldValN])`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
204+
**watch**(source: *`Array<Wrapper | () => any>`*, callback: *`([newVal1, newVal2, ... newValN], [oldVal1, oldVal2, ... oldValN])`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
223205

224206
The `watch` API provides a way to perform side effect based on reactive state changes.
225207

@@ -331,7 +313,7 @@ const Descendent = {
331313

332314
## Context
333315
The `context` object exposes a number of properties that were previously exposed on this in 2.x APIs:
334-
316+
335317
```js
336318
const MyComponent = {
337319
setup(props, context) {

README.zh-CN.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
# 安装
3030

31-
**npm**
31+
**npm**
3232
```bash
3333
npm install vue-function-api --save
3434
```
@@ -162,24 +162,6 @@ const MyComponent = {
162162
}
163163
```
164164

165-
```js
166-
import { value } from 'vue-function-api'
167-
168-
const MyComponent = {
169-
setup(props) {
170-
const msg = value('hello')
171-
const appendName = () => {
172-
msg.value = `hello ${props.name}`
173-
}
174-
return {
175-
msg,
176-
appendName
177-
}
178-
},
179-
template: `<div @click="appendName">{{ msg }}</div>`
180-
}
181-
```
182-
183165
## state
184166
**state**(value: *`any`*)
185167

@@ -217,9 +199,9 @@ console.log(countPlusOne.value) // 2
217199
```
218200

219201
## watch
220-
**watch**(source: *`Wrapper | () => any`*, callback: *`(newVal, oldVal)`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
202+
**watch**(source: *`Wrapper | () => any`*, callback: *`(newVal, oldVal)`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
221203

222-
**watch**(source: *`Array<Wrapper | () => any>`*, callback: *`([newVal1, newVal2, ... newValN], [oldVal1, oldVal2, ... oldValN])`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
204+
**watch**(source: *`Array<Wrapper | () => any>`*, callback: *`([newVal1, newVal2, ... newValN], [oldVal1, oldVal2, ... oldValN])`*, options?: *[`WatchOption`](#WatchOption)*): `Function`
223205

224206
`watch` 允许我们在相应的状态发生改变时执行一个回调函数。
225207

0 commit comments

Comments
 (0)
0