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