mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2024-11-10 09:39:14 +08:00
docs: update README
This commit is contained in:
parent
b95986ee90
commit
53d1c0f83d
@ -119,26 +119,12 @@ const App = {
|
||||
|
||||
v-model
|
||||
|
||||
* 修饰符:使用 (`_`) 代替 (`.`) (`vModel_trim={this.test}`)
|
||||
> 注意:如果想要使用 `arg`, 第二个参数需要为字符串
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
data: () => ({
|
||||
test: 'Hello World',
|
||||
}),
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<input type="text" vModel_trim={this.test} />
|
||||
{this.test}
|
||||
</>
|
||||
)
|
||||
},
|
||||
}
|
||||
<input vModel={val} />
|
||||
```
|
||||
|
||||
* 或者使用这种实现
|
||||
|
||||
```jsx
|
||||
<input vModel={[val, ['trim']]} />
|
||||
```
|
||||
@ -174,8 +160,6 @@ const App = {
|
||||
}
|
||||
```
|
||||
|
||||
> 注意:如果想要使用 `arg`, 第二个参数需要为字符串
|
||||
|
||||
### 插槽
|
||||
|
||||
```jsx
|
||||
|
20
README.md
20
README.md
@ -120,26 +120,12 @@ const App = {
|
||||
|
||||
v-model
|
||||
|
||||
* You can use underscore (`_`) instead of dot (`.`) for modifiers (`vModel_trim={this.test}`)
|
||||
> Note: You should pass the second param as string for using `arg`.
|
||||
|
||||
```jsx
|
||||
export default {
|
||||
data: () => ({
|
||||
test: 'Hello World',
|
||||
}),
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<input type="text" vModel_trim={this.test} />
|
||||
{this.test}
|
||||
</>
|
||||
)
|
||||
},
|
||||
}
|
||||
<input vModel={val} />
|
||||
```
|
||||
|
||||
* Or you can use this proposal.
|
||||
|
||||
```jsx
|
||||
<input vModel={[val, ['trim']]} />
|
||||
```
|
||||
@ -175,8 +161,6 @@ const App = {
|
||||
}
|
||||
```
|
||||
|
||||
> Note: You should pass the second param as string for using `arg`.
|
||||
|
||||
### Slot
|
||||
|
||||
```jsx
|
||||
|
Loading…
Reference in New Issue
Block a user