@tplc/business 0.4.91 → 0.4.92

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
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.4.92](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.91...v0.4.92) (2025-05-05)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 新增nav ([3e05736](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/3e05736e996ae5e2e69cdf8e127f21386aa96c6e))
11
+
5
12
  ### [0.4.91](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.4.90...v0.4.91) (2025-05-05)
6
13
 
7
14
 
@@ -39,6 +39,7 @@ import { computed, inject, Ref } from 'vue'
39
39
  import { LcbButtonProps } from './types'
40
40
  import { PAGE_PROVIDE_KEY } from '../../constants'
41
41
  import { getFlexStyle, transformValueUnit } from '../../utils/transform'
42
+ import { get } from 'lodash-es'
42
43
  defineOptions({
43
44
  name: 'LcbButton',
44
45
  options: {
@@ -61,9 +62,9 @@ const dynamicValue = computed(() => {
61
62
  let value = ''
62
63
  if (props.dynamicKey) {
63
64
  if (props.keyFromUser) {
64
- value = userStore?.userInfo?.[props.dynamicKey]
65
+ value = get(userStore?.userInfo, props.dynamicKey)
65
66
  } else {
66
- value = pageInfo.value?.[props.dynamicKey]
67
+ value = get(pageInfo.value, props.dynamicKey)
67
68
  }
68
69
  }
69
70
  return value
@@ -76,9 +77,9 @@ const innerValue = computed(() => {
76
77
  if (props.text && props.text.includes('${')) {
77
78
  value = props.text.replace(/\$\{([^}]+)\}/g, (_, p) => {
78
79
  if (props.keyFromUser) {
79
- return userStore?.userInfo?.[p] ?? props.textDefaultValue ?? ''
80
+ return get(userStore?.userInfo, p) ?? props.textDefaultValue ?? ''
80
81
  } else {
81
- return pageInfo.value?.[p] ?? props.textDefaultValue ?? ''
82
+ return get(pageInfo.value, p) ?? props.textDefaultValue ?? ''
82
83
  }
83
84
  })
84
85
  }
@@ -3,6 +3,7 @@
3
3
  v-bind="{
4
4
  ...$props,
5
5
  }"
6
+ v-if="showTitle"
6
7
  >
7
8
  <lcb-action-view :customClass="`!flex ${justify} !leading-none`" v-bind="action">
8
9
  <view
@@ -64,6 +65,7 @@
64
65
  import { LcbTitleProps } from './types'
65
66
  import { transformValueUnit } from '../../utils/transform'
66
67
  import { computed, inject } from 'vue'
68
+ import { get } from 'lodash-es'
67
69
  const themeColor = inject('theme-color', '#3875FF')
68
70
  defineOptions({
69
71
  name: 'LcbTitle',
@@ -97,4 +99,13 @@ const props = withDefaults(defineProps<LcbTitleProps>(), {
97
99
  const customStyle = computed(() => {
98
100
  return props.iconRight ? `margin-right:${transformValueUnit(props.iconRight)}` : ''
99
101
  })
102
+ const showTitle = computed(() => {
103
+ if (props.visibleKeyFromUser) {
104
+ const userInfo = uni.$lcb.userStore?.()?.userInfo
105
+ return props.visibleKeyReverse
106
+ ? !get(userInfo, props.visibleKeyFromUser)
107
+ : get(userInfo, props.visibleKeyFromUser)
108
+ }
109
+ return true
110
+ })
100
111
  </script>
@@ -35,4 +35,8 @@ export interface LcbTitleProps
35
35
  iconRight?: number
36
36
  iconSize?: number
37
37
  showIcon?: boolean
38
+ // 显示隐藏动态key
39
+ visibleKeyFromUser?: string
40
+ /** 依赖值反选 */
41
+ visibleKeyReverse?: boolean
38
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.4.91",
3
+ "version": "0.4.92",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -33,4 +33,7 @@ export interface LcbTitleProps
33
33
  iconRight?: number
34
34
  iconSize?: number
35
35
  showIcon?: boolean
36
+ visibleKeyFromUser?: string
37
+ /** 依赖值反选 */
38
+ visibleKeyReverse?: boolean
36
39
  }