<!--测试-->
<div class="form-group">
<div class="col-sm-2 control-label">{!! Form::label('txt','测试') !!}</div>
<div class="col-sm-10">
<select name="select_pri">
<option value="1">A</option>
<option value="2">B</option>
<option value="3">C</option>
<option value="4">D</option>
</select>
</div>
</div>
<!--测试1-->
<div class="form-group">
<div class="col-sm-2 control-label">{!! Form::label('men','男士') !!}</div>
<div class="col-sm-10">{!! Form::text('men',1,['class'=>'form-control','required'=>'required','v-model'=>'men']) !!}</div>
</div>
js代码如下
<script>
$(document).ready(function () {
$(':input[name=select_pri]').change(function () {
var key = $(this).val();
console.debug('ID:' + key);
$(':input[name=men]').val(key);
});
});
var vue = new Vue({
el: '#appVue',
data: {
men: $(':input[name=men]').val()
},
});
</script>