next-date-picker
项目种需要运用选择年月的组件,但是uni-app里面没有,所以通过查找资料找到一款插件
next-date-picker,本身也可以选择日,但是我把日隐藏了,具体可以参考链接地址
DCloud 插件市场DCloud 插件市场https://ext.dcloud.net.cn/search?q=next-date-picker
<template>
<view>
<view
style="display: flex;border: 2rpx solid #ccc;width: 90%;margin: 0 auto 10rpx auto;border-radius: 12rpx;padding: 20rpx;color: #B3B3B3;"
@click="show()">
<uni-icons type="search" size="18"></uni-icons>
<view style="padding-left: 20rpx;">{{currentSelect}}</view>
<view v-if="isShow">搜索</view>
</view>
<next-date-picker ref="nextDatePickerRef" :mode="simple" isAbleSelectFutureDate="false" :defaultDate="dateModel" @finishSelectDate="finishSelectDate" :defaultCheckedList="[]">
</next-date-picker>
</view>
</template>
<script>
import nextDatePicker from "../../../uni_modules/next-date-picker/components/next-date-picker/next-date-picker.vue"
export default {
components: {
nextDatePicker
},
data() {
return {
}
},
methods: {
show() {
this.$refs.nextDatePickerRef.open();
},
finishSelectDate(e) {
console.log(e)
},
}
}
</script>