初始化
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
<!-- label 为字段名 -->
|
||||
|
||||
<!-- isBorder 是否有边框 默认 true有-->
|
||||
<template>
|
||||
<!-- 因为之前钉钉之前的那个不能用着改装了一下微信小程序选择日期组件使用 -->
|
||||
<view class="input-box" :class="isBorder ? '' : 'border-none'">
|
||||
<view class="label"><text class="tex">*</text> {{label}}</view>
|
||||
<view @click="onClickDate" class="date-box">
|
||||
<view v-if="value" class="time">{{value}}</view>
|
||||
<view v-else class="time placeholder">请选择{{label}}</view>
|
||||
<image class="img" src="../../static/jiantou.png"></image>
|
||||
</view>
|
||||
<DateText ref="dateTime" :value="sea" :isAll="true" :current="true" @confirm="onConfirm">1212121</DateText>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { watch } from "vue";
|
||||
export default {
|
||||
props: {
|
||||
value: {
|
||||
default: ''
|
||||
},
|
||||
|
||||
isBorder: {
|
||||
default: true
|
||||
},
|
||||
label:{
|
||||
default: '时间'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sea: ''
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 点击打开选择日期
|
||||
onClickDate () {
|
||||
this.$refs.dateTime.show()
|
||||
},
|
||||
onConfirm(e) {
|
||||
this.$emit('input', e.selectRes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.input-box{
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
background: #fff;
|
||||
padding: 0 16rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 28rpx;
|
||||
border-bottom: 2rpx dashed #D9D9D9;
|
||||
.label{
|
||||
width: 200rpx;
|
||||
line-height: 40rpx;
|
||||
display: flex;
|
||||
.tex{
|
||||
display: block;
|
||||
width: 14rpx;
|
||||
color: #E14343;
|
||||
margin-right: 8rpx;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
.date-box{
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
.img{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-left: 4rpx;
|
||||
}
|
||||
.placeholder{
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.border-none{
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user