-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(omi): missing form element value
- Loading branch information
Showing
5 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { render, tag, Component, h } from '@/index' | ||
|
||
@tag('form-demo') | ||
class FormDemo extends Component { | ||
state = { | ||
show: true, | ||
value1: 'volvo', | ||
value2: '', | ||
} | ||
|
||
onChange = (evt) => { | ||
this.state.value1 = evt.target.value | ||
this.update() | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
{this.state.show && <select id="cars" value={this.state.value1} onChange={this.onChange} name="cars"> | ||
<option value="volvo">Volvo</option> | ||
<option value="saab">Saab</option> | ||
<option value="mercedes">Mercedes</option> | ||
<option value="audi">Audi</option> | ||
</select>} | ||
|
||
<select id="cars2" value={this.state.value2} name="cars"> | ||
<option value="volvo">Volvo</option> | ||
<option value="saab">Saab</option> | ||
<option value="mercedes">Mercedes</option> | ||
<option value="audi">Audi</option> | ||
</select> | ||
|
||
<button onClick={(evt) => { | ||
this.state.show = !this.state.show | ||
this.update() | ||
}}>验证this.update后表单状态</button> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
render(<form-demo />, document.body) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "omi", | ||
"version": "7.3.9", | ||
"version": "7.3.10", | ||
"scripts": { | ||
"start": "vite", | ||
"dev-vite": "vite", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters