You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
776 B

<template>
<view style="width: 100%;">
<u-input :value="value" type="select" @click="show = true" :placeholder="placeholder"/>
<u-action-sheet :list="dataC" v-model="show" @click="actionSheetCallback"></u-action-sheet>
</view>
</template>
<script>
export default {
props: {
value: {
type: String,
default: null
},
data:{
type:Array,
default:[]
},
placeholder: {
type: String,
default: '请选择'
}
},
computed:{
dataC(){
var d = [];
this.data.forEach(item => {
d.push({
text:item
})
})
return d;
}
},
data() {
return {
show: false
}
},
methods: {
actionSheetCallback(index) {
this.$emit("input", this.data[index])
}
},
}
</script>
<style>
</style>

Powered by TurnKey Linux.