Avalon.js 操作Select 选中
<!DOCTYPE html><html>
<head>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="dist/avalon.js"></script>
<script>
var vm = avalon.define({
$id: 'test',
aaa: "111",
aa: {ddd:1},
selected: '1'
arr: [{value:'1', text:'aaa'},{value:'2', text:'bbb'}]
})
</script>
</head>
<body ms-controller="test">
<select ms-duplex="@selected">
<option ms-for="el in @arr" ms-attr="{value:el.value}">{{el.text}}</option>
</select>
</body></html>
<table class="table table-bordered">
<thead>
<tr>
<th>序号</th>
<th>病例步骤名</th>
<th>步骤分值权重</th>
<th>描述</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr ms-repeat-item="CaseStepWeightingData">
<td>{{item.CaseNum}}</td>
<td>{{item.OperationStepName}}</td>
<td>{{item.CaseScoreWeight}}</td>
<td>{{item.CaseDesc}}</td>
<td><a style="color: #428bca" ms-click="EditCaseStep(item)">编辑</a>
<a style="color: red; margin-left: 5px" ms-click="DelCaseStepWeighting(item)">删除</a>
<a style="color: red; margin-left: 5px" ms-href="'/View/ViewForm/BLGL/'+item.StepFormCode+'.aspx?BzId='+item.CaseStepWeightingId+'&baseID='+item.CaseBaseInfoId">编辑步骤</a>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<th style="width: 100px">
<input type="text" class="form-control" ms-duplex="CaseStepWeighting.CaseNum" /></th>
<th>
// ms-duplex="tempmodel.CaseStepWeighting.CaseOperationStepCode"
<select id="selBZ" class="form-control" ms-duplex="@tempmodel.CaseStepWeighting.CaseOperationStepCode">
<option ms-repeat-item="StepData" ms-attr-value="item.CaseOperationStepCode">{{item.OperationStepName}}</option>
<option ms-if="StepData.size()==0" value="">无未添加步骤记录</option>
</select></th>
<th>
<input type="text" class="form-control" ms-duplex="CaseStepWeighting.CaseScoreWeight" /></th>
<th>
<input type="text" class="form-control" ms-duplex="CaseStepWeighting.CaseDesc" /></th>
<th>
<input type="button" class="btn btn-sm btn-warning" value="添加步骤权重" ms-click="SaveCaseStepWeighting()" /></th>
</tr>
</tfoot>
</table>
本文来自博客园,作者:零一の世界,转载请注明原文链接:https://www.cnblogs.com/ings/p/15695307.html