鍍金池/ 問答/HTML5  HTML/ vue單選會影響到時間插件,將input里的時間給回到默認

vue單選會影響到時間插件,將input里的時間給回到默認

vue頁面中,引入了bootstrap-datepicker時間插件,本來以為很簡單了發(fā)現(xiàn)有坑,我時間插件擁有默認時間,下面的input的radio選中會將我選好的時間給調(diào)到剛開始的的效果。下面上代碼
<div id="myapp">

    <div style="width: 200px;margin-top: 40px;margin-left: 100px">
        <input class="startTime form-control input-inline input-small date-picker"  type="text" placeholder="選擇日期" v-model="abcd" ref="input1">
    </div>
    <input type="radio" v-model="gender" value="1">  <label>是</label>
    <input type="radio" v-model="gender" value="2">  <label>否</label> 
</div>

jQuery(document).ready(function($) {

$('.startTime').datepicker({
    orientation: "top",
    autoclose: true,
    language: "zh-CN",
    format: 'yyyy-mm-dd'
})

});
var app = new Vue({

el:"#myapp",
data:function(){
    return{
        abcd: "2017"
    }
},
methods:{
    
},
created:function(){

}

})
點擊下面單選框的時候就會會將選好的時候變成默認值2017,如果沒有默認值也就變成空了

回答
編輯回答
背叛者

為什么要有用bootstrap-datepicker。不去找一個vue的datepicker

2017年5月15日 05:55