我有一个日期组件,其中包含以下内容:
<template>
<div class="container">
<div class="row">
<label for="idName" class="col-xs-2 dateParagraphs" >{{transition }} Date: </label>
<datepicker v-model="dateObject" class="col-xs-2 dateParagraphs" id="datepickerID"></datepicker>
<label class="col-xs-3" >{{transition }} Time: </label>
<vue2-timepicker class="col-xs-3 dateParagraphs" format="hh:mm:ss a" id="timepick" ></vue2-timepicker>
</div>
</div>
</template>
datepicker和vue2-timepicker是两个子组件。在我的App.vue文件中,我访问了它们两次:
<template>
<div id="app">
<div class="row">
<div class="dates">
<date transition="Beginning" class="dateAndTime"></date>
<br/><br/><br/>
<date transition="Ending" class="dateAndTime"></date>
</div>
</div>
</div>
</template>
我想得到每个timepicker和datepicker的输入值。由于timepicker和datepicker的每个值都不同,我如何获取每个timepicker和datepicker的两个输入值?