mint-ui picker warn
[Vue warn]: Computed property "values" was assigned to but it has no setter.
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/mint-ui/lib/index.js"></script>
<div id="app">
<mt-picker :slots="dateSlots" @change="onDateChange" :visible-item-count="3"></mt-picker>
</div>
SCSS
@import url("//unpkg.com/mint-ui/lib/style.css")
Babel + JSX
var Main = {
data() {
return {
dateSlots: [
{
flex: 1,
values: ['2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016'],
className: 'slot1',
textAlign: 'right',
}, {
divider: true,
content: '-',
className: 'slot2',
}, {
flex: 1,
values: ['2002', '2003', '2004', '2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016'],
className: 'slot3',
textAlign: 'left',
},
],
}
},
methods: {
onDateChange(picker, values) {
if (values[0] > values[1]) {
picker.setSlotValue(1, values[0]);
}
this.dateStart = values[0];
this.dateEnd = values[1];
},
},
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')