早上好。我对 buefy timepicker 有疑问。如果我使用“清除”或“现在”按钮而不是选择时间,它会起作用。这似乎是从最近的 buefy 更新开始的。
https://codepen.io/anon/pen/JqBKGE?&editable=true&editors=101
<div id="app" class="container">
<textarea style="width: 100%;" readonly>{{ time }}</textarea>
<b-field label="Select time">
<b-timepicker v-model="time"
inline
placeholder="Click to select...">
<button class="button is-primary"
@click="time = new Date()">
<b-icon icon="clock"></b-icon>
<span>Now</span>
</button>
<button class="button is-danger"
@click="time = null">
<b-icon icon="close"></b-icon>
<span>Clear</span>
</button>
</b-timepicker>
</b-field>
</div>
JS
const example = {
data() {
return {
time: new Date()
}
},
watch: {
time: {
handler: function() {
console.log(this.time);
}
}
}
}
const app = new Vue(example)
app.$mount('#app')
有什么建议么?