UNPKG
gtht-miniapp-sdk
Version:
latest (1.2.9)
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.9
1.1.8
1.1.7
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
gtht-miniapp-sdk 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
gtht-miniapp-sdk
/
use
/
useTwoWayVisible.js
14 lines
(13 loc)
•
331 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import
{ ref, watch }
from
'vue'
;
export
function
useTwoWayVisible
(
props, emit
) {
const
visible =
ref
(props.
visible
);
watch
(
() =>
props.
visible
,
() =>
{ visible.
value
= props.
visible
; });
watch
(visible,
() =>
{
emit
(
'update:visible'
, !!visible.
value
); });
return
{ visible, }; }