This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-ios-roller-picker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue-ios-roller-picker
A Vue.js project
Build Setup
# install dependenciesnpminstall# serve with hot reload at localhost:8080npm run dev
# build for production with minificationnpm run build
install
npm install vue-ios-roller-picker
example
import vueIosRollerPicker from 'vue-ios-roller-picker'
Vue.use(vueIosRollerPicker)
<template>
<div class="panel">
<div class="title">
Time
<div class="val">
{{time}}
</div>
</div>
<rollerPickerBox>
<rollerPicker :data="hours" :index="hourIndex" @change="onHourChange" :options="{loop:true}"></rollerPicker>
<rollerPicker :data="minutes" :index="minuteIndex" @change="onMinuteChange" :options="{loop:true}"></rollerPicker>
</rollerPickerBox>
</div>
</template>
<script>
const getDoubleBitNumber = (n) => {
return n < 10 ? '0' + n : (n + '')
}
export default {
data () {
return {
hourIndex: 0,
minuteIndex: 0
}
},
computed:{
hours () {
const arr = []
for (let i = 0; i <= 23; i++) {
arr.push({value: i, text: getDoubleBitNumber(i)})
}
return arr
},
minutes () {
const arr = []
for (let i = 0; i <= 59; i++) {
arr.push({value: i, text: getDoubleBitNumber(i)})
}
return arr
},
time () {
return this.hours[this.hourIndex].text + ':' + this.minutes[this.minuteIndex].text
}
},
methods: {
onHourChange (index) {
this.hourIndex = index
},
onMinuteChange (index) {
this.minuteIndex = index
}
}
}
</script>
rollerPickerBox props
name
type
explain
layer
Boolean
Show mask or not.
lineColor
String
Sets the color of the selected portion of the border.