@jnrs/vue-core 1.2.29 → 1.2.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.
package/AGENTS.md CHANGED
@@ -744,25 +744,25 @@ const dialogVisible = ref(false)
744
744
 
745
745
  #### JnDateQuery
746
746
 
747
- 通用时间查询组件,合并两种使用场景:固定类型模式(配合快捷按钮)和可切换类型模式(内置类型切换器)。通过 `type` 配置绑定值为单个时间或时间范围。
747
+ 通用时间查询组件,支持日/周/月/年/任意区间五种时间类型切换,配合快捷按钮实现前后时间段快速导航。推荐使用 `showTypeSwitcher` 模式(时间查询),可覆盖所有时间类型的查询需求。
748
748
 
749
749
  **Props:**
750
750
 
751
- | 属性名 | 类型 | 默认值 | 说明 |
752
- | ----------------- | --------------------------------------------------- | --------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
753
- | modelValue | `string \| [string, string]` | — | v-model 绑定值(`type='date'/'month'/'year'` 为 string,`type='week'/'daterange'` 为 [string, string]) |
754
- | type | `'date' \| 'week' \| 'month' \| 'year' \| 'daterange'` | `'date'` | 日期类型;`showTypeSwitcher=true` 时作为初始类型 |
755
- | showTypeSwitcher | `boolean` | `false` | 是否显示类型切换器 |
756
- | switcherStyle | `'select' \| 'button-group'` | `'select'` | 切换器风格(下拉选择 or 按钮组) |
757
- | typeOptions | `DateType[]` | `['date','week','month','year','daterange']` | 可切换的类型选项 |
758
- | quickButtons | `'none' \| 'arrows' \| 'group'` | `'none'` | 快捷按钮风格(无 / 左右箭头 / 按钮组) |
759
- | valueFormat | `string` | `'YYYY-MM-DD'` | 日期格式 |
760
- | clearable | `boolean` | `false` | 是否可清除 |
761
- | size | `'' \| 'small' \| 'default' \| 'large'` | `'default'` | 尺寸 |
762
- | placeholder | `string` | `'选择日期'` | 单值 placeholder |
763
- | startPlaceholder | `string` | `'开始日期'` | 范围开始 placeholder |
764
- | endPlaceholder | `string` | `'结束日期'` | 范围结束 placeholder |
765
- | rangeSeparator | `string` | `'至'` | 范围分隔符 |
751
+ | 属性名 | 类型 | 默认值 | 说明 |
752
+ | ---------------- | ------------------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
753
+ | modelValue | `string \| [string, string]` | — | v-model 绑定值(`type='date'/'month'/'year'` 为 string,`type='week'/'daterange'` 为 [string, string]) |
754
+ | type | `'date' \| 'week' \| 'month' \| 'year' \| 'daterange'` | `'date'` | 日期类型;`showTypeSwitcher=true` 时作为初始类型 |
755
+ | showTypeSwitcher | `boolean` | `false` | 是否显示类型切换器(推荐开启,可覆盖所有时间类型) |
756
+ | switcherStyle | `'select' \| 'button-group'` | `'select'` | 切换器风格(下拉选择 or 按钮组) |
757
+ | typeOptions | `DateType[]` | `['date','week','month','year','daterange']` | 可切换的类型选项 |
758
+ | quickButtons | `'none' \| 'arrows' \| 'group'` | `'none'` | 快捷按钮风格(无 / 左右箭头 / 按钮组);`arrows` 模式支持 date/week/month/year(不含 daterange) |
759
+ | valueFormat | `string` | `'YYYY-MM-DD'` | 日期格式 |
760
+ | clearable | `boolean` | `false` | 是否可清除 |
761
+ | size | `'' \| 'small' \| 'default' \| 'large'` | `'default'` | 尺寸 |
762
+ | placeholder | `string` | `'选择日期'` | 单值 placeholder |
763
+ | startPlaceholder | `string` | `'开始日期'` | 范围开始 placeholder |
764
+ | endPlaceholder | `string` | `'结束日期'` | 范围结束 placeholder |
765
+ | rangeSeparator | `string` | `'至'` | 范围分隔符 |
766
766
 
767
767
  **Events:**
768
768
 
@@ -770,28 +770,7 @@ const dialogVisible = ref(false)
770
770
  - `change` - 值变化时触发,参数为 `(value, type)`
771
771
  - `type-change` - 类型切换时触发,参数为 `(type)`
772
772
 
773
- **使用示例 1:工厂日历场景(固定类型 + 快捷按钮组)**
774
-
775
- ```vue
776
- <template>
777
- <JnDateQuery
778
- v-model="monthValue"
779
- type="month"
780
- quick-buttons="group"
781
- value-format="YYYY-MM-DD"
782
- placeholder="选择月份"
783
- />
784
- </template>
785
-
786
- <script setup>
787
- import { ref } from 'vue'
788
- import { JnDateQuery } from '@jnrs/vue-core/components'
789
-
790
- const monthValue = ref('')
791
- </script>
792
- ```
793
-
794
- **使用示例 2:生产统计场景(可切换类型 + 按钮组切换器)**
773
+ **使用示例:时间查询(推荐,覆盖日/周/月/年/区间)**
795
774
 
796
775
  ```vue
797
776
  <template>
@@ -803,6 +782,9 @@ const monthValue = ref('')
803
782
  :type-options="['date', 'week', 'month', 'year', 'daterange']"
804
783
  quick-buttons="arrows"
805
784
  value-format="YYYY-MM-DD"
785
+ placeholder="选择日期"
786
+ start-placeholder="开始日期"
787
+ end-placeholder="结束日期"
806
788
  />
807
789
  </template>
808
790
 
@@ -810,10 +792,12 @@ const monthValue = ref('')
810
792
  import { ref } from 'vue'
811
793
  import { JnDateQuery } from '@jnrs/vue-core/components'
812
794
 
813
- const dateValue = ref<string | [string, string]>('')
795
+ const dateValue = (ref < string) | ([string, string] > '')
814
796
  </script>
815
797
  ```
816
798
 
799
+ > 完整案例参见模板工程 `src/views/examples/playground/index.vue` 中的「JnDateQuery 时间查询」章节。
800
+
817
801
  ---
818
802
 
819
803
  #### GlobalSetting
package/CHANGELOG.md CHANGED
@@ -1,6 +1,22 @@
1
1
  # 发版日志
2
2
 
3
- ## [1.2.29] - 2026-07-27 【latest】
3
+ ## [1.2.31] - 2026-07-27 【latest】
4
+
5
+ ### Fixed
6
+
7
+ - `JnDateQuery`:修复 `switcher-style="select"` 时切换时间类型导致 `modelValue` 错乱的问题,将 `v-model="currentType"` 改为 `:value="currentType"`,确保类型切换逻辑通过 `handleTypeChange` 统一处理,避免 v-model 提前更新跳过值转换
8
+
9
+ ## [1.2.30] - 2026-07-27
10
+
11
+ ### Fixed
12
+
13
+ - `JnDateQuery`:`arrows` 快捷切换模式现在支持 `week` 类型(上周/下周快捷导航),此前因 `isRange` 判断导致周类型下箭头按钮被隐藏
14
+
15
+ ### Documentation
16
+
17
+ - `AGENTS.md` 精简 `JnDateQuery` 文档:合并为单一「时间查询」使用示例(推荐 `showTypeSwitcher` 模式),补充 `arrows` 模式类型支持范围说明,指向 playground 完整案例
18
+
19
+ ## [1.2.29] - 2026-07-27
4
20
 
5
21
  ### Features
6
22