uview-plus 3.3.73 → 3.4.0

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/changelog.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 3.4.0(2025-03-08)
2
+ feat: 新机制确保setConfig与http在nvue等环境下生效
3
+
4
+ ## 3.3.74(2025-03-06)
5
+ fix: CateTab语法问题
6
+
7
+ ## 3.3.73(2025-03-06)
8
+ feat: CateTab新增v-model:current属性
9
+
1
10
  ## 3.3.72(2025-02-28)
2
11
  feat: tabs组件支持icon图标及插槽
3
12
 
@@ -58,10 +58,10 @@
58
58
  type: String,
59
59
  default: 'name'
60
60
  },
61
- current: : {
61
+ current: {
62
62
  type: Number,
63
63
  default: 0
64
- },
64
+ }
65
65
  },
66
66
  watch: {
67
67
  tabList() {
package/index.js CHANGED
@@ -5,8 +5,6 @@
5
5
  import { mixin } from './libs/mixin/mixin.js'
6
6
  // 小程序特有的mixin
7
7
  import { mpMixin } from './libs/mixin/mpMixin.js'
8
- // 全局挂载引入http相关请求拦截插件
9
- import Request from './libs/luch-request'
10
8
 
11
9
  // 路由封装
12
10
  import route from './libs/util/route.js'
@@ -33,8 +31,10 @@ import color from './libs/config/color.js'
33
31
  // 平台
34
32
  import platform from './libs/function/platform'
35
33
 
34
+ // http
35
+ import http from './libs/function/http.js'
36
+
36
37
  // 导出
37
- const http = new Request()
38
38
  let themeType = ['primary', 'success', 'error', 'warning', 'info'];
39
39
  export { route, http, debounce, throttle, platform, themeType, mixin, mpMixin, props, color, test, zIndex }
40
40
  export * from './libs/function/index.js'
@@ -107,13 +107,21 @@ function toCamelCase(str) {
107
107
  });
108
108
  }
109
109
 
110
- const install = (Vue) => {
110
+ const install = (Vue, upuiParams = '') => {
111
111
  // #ifdef H5
112
112
  components.forEach(function(component) {
113
113
  const name = component.name.replace(/u-([a-zA-Z0-9-_]+)/g, 'up-$1');
114
114
  Vue.component(name, component);
115
115
  });
116
116
  // #endif
117
+
118
+ // 初始化
119
+ if (upuiParams) {
120
+ uni.upuiParams = upuiParams
121
+ let temp = upuiParams()
122
+ temp.httpIns(http)
123
+ setConfig(temp.options)
124
+ }
117
125
 
118
126
  // 同时挂载到uni和Vue.prototype中
119
127
  // $u挂载到uni对象上
@@ -1,3 +1,5 @@
1
+ import props from './props.js'
2
+ import index from '../function/index.js'
1
3
  const version = '3'
2
4
 
3
5
  // 开发环境才提示,生产环境不会提示
@@ -4,7 +4,14 @@
4
4
  * 无需在每个引入组件的页面中都配置一次
5
5
  */
6
6
  import config from './config'
7
-
7
+ // 各个需要fixed的地方的z-index配置文件
8
+ import zIndex from './zIndex.js'
9
+ // 关于颜色的配置,特殊场景使用
10
+ import color from './color.js'
11
+ // http
12
+ import http from '../function/http.js'
13
+ import { shallowMerge } from '../function/index.js'
14
+ // 组件props
8
15
  import ActionSheet from '../../components/u-action-sheet/actionSheet'
9
16
  import Album from '../../components/u-album/album'
10
17
  import Alert from '../../components/u-alert/alert'
@@ -94,11 +101,7 @@ import Tooltip from '../../components/u-tooltip/tooltip'
94
101
  import Transition from '../../components/u-transition/transition'
95
102
  import Upload from '../../components/u-upload/upload'
96
103
 
97
- const {
98
- color
99
- } = config
100
-
101
- export default {
104
+ const props = {
102
105
  ...ActionSheet,
103
106
  ...Album,
104
107
  ...Alert,
@@ -188,3 +191,20 @@ export default {
188
191
  ...Transition,
189
192
  ...Upload
190
193
  }
194
+
195
+ function setConfig(configs) {
196
+ shallowMerge(config, configs.config || {})
197
+ shallowMerge(props, configs.props || {})
198
+ shallowMerge(color, configs.color || {})
199
+ shallowMerge(zIndex, configs.zIndex || {})
200
+ }
201
+
202
+ // 初始化自定义配置
203
+ if (uni && uni.upuiParams) {
204
+ console.log('setting uview-plus')
205
+ let temp = uni.upuiParams()
206
+ temp.httpIns(http)
207
+ setConfig(temp.options)
208
+ }
209
+
210
+ export default props
@@ -0,0 +1,4 @@
1
+ // 全局挂载引入http相关请求拦截插件
2
+ import Request from '../luch-request'
3
+ const http = new Request()
4
+ export default http
@@ -33,7 +33,8 @@ export default class Request {
33
33
  * @param {Boolean} arg.firstIpv4 - 全DNS解析时优先使用ipv4。默认false。仅 App-Android 支持 (HBuilderX 2.8.0+)
34
34
  * @param {Function(statusCode):Boolean} arg.validateStatus - 全局默认的自定义验证器。默认statusCode >= 200 && statusCode < 300
35
35
  */
36
- constructor(arg = {}) {
36
+ constructor(arg = {}) {
37
+ console.info('初始化luch-request')
37
38
  if (!isPlainObject(arg)) {
38
39
  arg = {}
39
40
  console.warn('设置全局参数必须接收一个Object')
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
4
  "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3鸿蒙移动组件库。",
5
- "version": "3.3.73",
5
+ "version": "3.4.0",
6
6
  "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",