jobsys-explore 1.0.7 → 1.0.9

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.
@@ -0,0 +1,5 @@
1
+ ---
2
+ "jobsys-explore": patch
3
+ ---
4
+
5
+ Fix pagination after fetched and add provider
@@ -0,0 +1,5 @@
1
+ ---
2
+ "jobsys-explore": patch
3
+ ---
4
+
5
+ Inject pagination provider and fix pagination autoload
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # jobsys-explore
2
2
 
3
+ ## 1.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix pagination after fetched and add provider
8
+ - Use changeset instead of release-it
9
+ - Inject pagination provider and fix pagination autoload
10
+
11
+ ## 1.0.8
12
+
13
+ ### Patch Changes
14
+
15
+ - Fix pagination after fetched and add provider
16
+ - Use changeset instead of release-it
17
+
3
18
  ## 1.0.7
4
19
 
5
20
  ### Patch Changes
@@ -1,8 +1,9 @@
1
- import { computed, defineComponent, ref } from "vue"
1
+ import { computed, defineComponent, inject, ref } from "vue"
2
2
  import { usePage } from "../../hooks"
3
3
  import { Empty, List } from "vant"
4
4
  import ExSearch from "../search/ExSearch.jsx"
5
5
  import "./index.less"
6
+ import { EX_PAGINATION } from "../provider/ExProvider.jsx"
6
7
 
7
8
  /**
8
9
  * ExPagination 翻页
@@ -70,6 +71,9 @@ export default defineComponent({
70
71
  },
71
72
  setup(props, { expose, slots }) {
72
73
  let pagination = ref(null)
74
+
75
+ const paginationProvider = inject(EX_PAGINATION, () => ({}))
76
+
73
77
  if (props.useStore?.initPagination) {
74
78
  props.useStore.initPagination({
75
79
  uri: props.url,
@@ -84,7 +88,7 @@ export default defineComponent({
84
88
  }
85
89
 
86
90
  const loadMore = (refresh) => {
87
- usePage(pagination?.value, refresh)
91
+ usePage(pagination?.value, refresh, props.afterFetched || paginationProvider.afterFetched || null)
88
92
  }
89
93
 
90
94
  const onSearch = (params) => {
@@ -120,7 +124,7 @@ export default defineComponent({
120
124
  <List
121
125
  /*v-model:loading={pagination.value.loading}*/
122
126
  v-model:error={pagination.value.error}
123
- immediateCheck={props.autoLoad}
127
+ immediateCheck={false}
124
128
  finished={pagination.value.finished}
125
129
  finishedText={props.finishText}
126
130
  errorText={props.errorText}
@@ -3,6 +3,7 @@ import { defineComponent, provide } from "vue"
3
3
  export const EX_UPLOADER = Symbol("EX_UPLOADER")
4
4
  export const EX_FORM = Symbol("EX_FORM")
5
5
  export const EX_SEARCH = Symbol("EX_SEARCH")
6
+ export const EX_PAGINATION = Symbol("EX_PAGINATION")
6
7
 
7
8
  /**
8
9
  * Explore 配置组件
@@ -15,6 +16,7 @@ export default defineComponent({
15
16
  * @property {UploaderProviderProps} [uploader] `ExUploader` 配置
16
17
  * @property {FormProviderProps} [form] `ExForm` 配置
17
18
  * @property {SearchProviderProps} [search] `ExSearch` 配置
19
+ * @property {PaginationProviderProps} [pagiantion] `ExPagination` 配置
18
20
  *
19
21
  */
20
22
  props: {
@@ -69,6 +71,17 @@ export default defineComponent({
69
71
  inputClass: "",
70
72
  }),
71
73
  },
74
+
75
+ /**
76
+ * @typedef {Object} PaginationProviderProps `ExPagination` 配置
77
+ * @property {Function} [afterFetched] 处理接口返回数据的函数
78
+ */
79
+ pagination: {
80
+ type: Object,
81
+ default: () => ({
82
+ afterFetched: null,
83
+ }),
84
+ },
72
85
  },
73
86
  setup(props, { slots }) {
74
87
  provide(EX_UPLOADER, {
@@ -85,6 +98,7 @@ export default defineComponent({
85
98
  inputClass: "",
86
99
  ...props.search,
87
100
  })
101
+ provide(EX_PAGINATION, { afterFetched: null, ...props.pagination })
88
102
 
89
103
  return () => <div>{slots.default?.()}</div>
90
104
  },