mirror of
https://gitee.com/dromara/go-view.git
synced 2024-12-02 03:38:27 +08:00
feat: 动态日期,初始化日期
This commit is contained in:
parent
a2184b19b3
commit
76e511daa0
@ -56,7 +56,6 @@ const onChange = (v: number | number[]) => {
|
||||
}
|
||||
}
|
||||
|
||||
// 手动更新
|
||||
watch(
|
||||
() => props.chartConfig.option.dataset,
|
||||
(newData: number | number[]) => {
|
||||
@ -68,6 +67,25 @@ watch(
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
|
||||
// 手动更新
|
||||
watch(
|
||||
() => props.chartConfig.option.differValue,
|
||||
(newData: number) => {
|
||||
if (props.chartConfig.option.differValue === 0) return
|
||||
if (typeof option.dataset === 'object') {
|
||||
option.dataset[0] = dayjs().add(newData, 'day').valueOf()
|
||||
option.dataset[1] = dayjs().add(newData, 'day').valueOf()
|
||||
} else {
|
||||
option.dataset = dayjs().add(newData, 'day').valueOf()
|
||||
}
|
||||
// 关联目标组件首次请求带上默认内容
|
||||
onChange(newData)
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
Loading…
Reference in New Issue
Block a user