【类 型】:feat
【主 题】:日期选择器组件 加入props 插入函数 【描 述】: [原因]:外部调用时 用于初始化日期 [过程]:加入props参数 [影响]: 【结 束】 # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
c88248308e
commit
64bb74aba6
@ -6,10 +6,21 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
props: {
|
||||||
|
startDate: {
|
||||||
|
type: Number,
|
||||||
|
default () {
|
||||||
|
return Math.floor(new Date(new Date().setHours(0, 0, 0, 0)).getTime() / 1000)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
endDate: {
|
||||||
|
type: Number,
|
||||||
|
default () {
|
||||||
|
return Math.floor(new Date(new Date().setHours(23, 59, 59, 999)).getTime() / 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data () {
|
data () {
|
||||||
const orderSearch = this.$store.getters['app/getOrderSerch']
|
|
||||||
const startTimestamp = orderSearch.start_time
|
|
||||||
const endTimestamp = orderSearch.end_time
|
|
||||||
return {
|
return {
|
||||||
pickerOptions: {
|
pickerOptions: {
|
||||||
shortcuts: [
|
shortcuts: [
|
||||||
@ -82,7 +93,7 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
value: [startTimestamp, endTimestamp]
|
value: [new Date(this.startDate * 1000), new Date(this.endDate * 1000)]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
Loading…
Reference in New Issue
Block a user