|
这样写看看?我这边测试没有问题的。
- <radio-group
- style="flex-direction: row; width:100%; padding:10px 0px;border-bottom:1px solid #ddd; margin-top: 10px;"
- onChange={this.health_MindChanged}>
- <text>头脑:</text>
- <label style="width:80px;">
- <radio :checked="mind==1" color="#f0f" value="1"/>
- <text style="padding:0px 10px;">正常</text>
- </label>
- <label>
- <radio :checked="mind==0" color="#f0f" value="0"/>
- <text style="padding-left:10px;">需要协助</text>
- </label>
- </radio-group>
- <button @click="showMind">查看</button>
复制代码
- data() {
- return{
- mind:"1"
- }
- },
- methods: {
- health_MindChanged(e){
- console.log("-------health_MindChanged--------"+e.detail.value);
- this.data.mind=e.detail.value;
- },
- showMind(){
- api.alert({
- msg: `当前mind是: ${this.data.mind}`
- })
- }
- }
复制代码
|
|