vue2server7 7.0.29 → 7.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -102,8 +102,8 @@ const props = withDefaults(defineProps<{
|
|
|
102
102
|
endPlaceholder: '结束日期',
|
|
103
103
|
separator: '至',
|
|
104
104
|
pickerType: 'date',
|
|
105
|
-
valueFormat: '
|
|
106
|
-
displayFormat:
|
|
105
|
+
valueFormat: 'YYYYMMDD',
|
|
106
|
+
displayFormat: 'YYYY-MM-DD',
|
|
107
107
|
disabled: false,
|
|
108
108
|
linkage: true,
|
|
109
109
|
maxSpanDays: undefined,
|
|
@@ -127,8 +127,16 @@ const startFocused = ref(false)
|
|
|
127
127
|
const endFocused = ref(false)
|
|
128
128
|
const hasBlurred = ref(false)
|
|
129
129
|
|
|
130
|
+
/** 解析绑定值:支持 YYYYMMDD(与默认 valueFormat 一致)及 ISO 等可被 Date 解析的字符串 */
|
|
130
131
|
function toDate(val: string | null | undefined): Date | null {
|
|
131
132
|
if (!val) return null
|
|
133
|
+
if (/^\d{8}$/.test(val)) {
|
|
134
|
+
const y = Number(val.slice(0, 4))
|
|
135
|
+
const m = Number(val.slice(4, 6)) - 1
|
|
136
|
+
const day = Number(val.slice(6, 8))
|
|
137
|
+
const d = new Date(y, m, day)
|
|
138
|
+
return Number.isNaN(d.getTime()) ? null : d
|
|
139
|
+
}
|
|
132
140
|
const d = new Date(val)
|
|
133
141
|
return Number.isNaN(d.getTime()) ? null : d
|
|
134
142
|
}
|
|
@@ -76,7 +76,7 @@ const startField = ref<string | null>(null)
|
|
|
76
76
|
const endField = ref<string | null>(null)
|
|
77
77
|
const rangeMaxSpan = ref<DateRangeValue>([null, null])
|
|
78
78
|
const rangeDatetime = ref<DateRangeValue>([null, null])
|
|
79
|
-
const rangeDisabled = ref<DateRangeValue>(['
|
|
79
|
+
const rangeDisabled = ref<DateRangeValue>(['20260101', '20260131'])
|
|
80
80
|
</script>
|
|
81
81
|
|
|
82
82
|
<style scoped>
|
package/package.json
CHANGED
package/test/11111111111
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
let el = $0
|
|
2
|
+
while (el) {
|
|
3
|
+
if (el.__vueParentComponent) {
|
|
4
|
+
console.log('找到了 Vue3 实例:', el)
|
|
5
|
+
console.log(el.__vueParentComponent)
|
|
6
|
+
break
|
|
7
|
+
}
|
|
8
|
+
el = el.parentElement
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
el.__vueParentComponent.setupState
|
|
12
|
+
|
|
13
|
+
let el = $0
|
|
14
|
+
while (el) {
|
|
15
|
+
const comp = el.__vueParentComponent
|
|
16
|
+
if (comp) {
|
|
17
|
+
const data = comp.setupState || comp.ctx
|
|
18
|
+
if (data && data.forrcats) {
|
|
19
|
+
console.log('找到了 forrcats:', data.forrcats)
|
|
20
|
+
break
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
el = el.parentElement
|
|
24
|
+
}
|