fix: 不显示问题
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
* @Author: zhaojinfeng 121016171@qq.com
|
* @Author: zhaojinfeng 121016171@qq.com
|
||||||
* @Date: 2023-07-23 16:27:37
|
* @Date: 2023-07-23 16:27:37
|
||||||
* @LastEditors: zhaojinfeng 121016171@qq.com
|
* @LastEditors: zhaojinfeng 121016171@qq.com
|
||||||
* @LastEditTime: 2023-07-23 17:28:40
|
* @LastEditTime: 2023-07-23 17:54:15
|
||||||
* @FilePath: \vue3\packages\mask-text\index.vue
|
* @FilePath: \vue3\packages\mask-text\index.vue
|
||||||
* @Description: 敏感数据隐藏组件
|
* @Description: 敏感数据隐藏组件
|
||||||
*
|
*
|
||||||
@ -26,13 +26,14 @@ const props = withDefaults(defineProps<{
|
|||||||
const [value, toggle] = useToggle(true)
|
const [value, toggle] = useToggle(true)
|
||||||
|
|
||||||
const data = computed(() => {
|
const data = computed(() => {
|
||||||
if (!value.value || !props.text)
|
if (!props.text)
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
const left = props.left < 0 ? 0 : props.left
|
const left = props.left < 0 ? 0 : props.left
|
||||||
const right = props.right < 0 ? 0 : props.right
|
const right = props.right < 0 ? 0 : props.right
|
||||||
const textLength = props.text.length
|
const textLength = props.text.length
|
||||||
if (left > textLength
|
if (!value.value
|
||||||
|
|| left > textLength
|
||||||
|| right > textLength
|
|| right > textLength
|
||||||
|| right + left > textLength
|
|| right + left > textLength
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user