修复 z-index 层级问题
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useRef } from "react";
|
||||
import React, { useState, useRef, useEffect } from "react";
|
||||
import { View, Text, Image } from "@tarojs/components";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { useUserInfo } from "@/store/userStore";
|
||||
@@ -15,10 +15,17 @@ import NTRPEvaluatePopup from "../NTRPEvaluatePopup";
|
||||
export interface PublishMenuProps {
|
||||
onPersonalPublish?: () => void;
|
||||
onActivityPublish?: () => void;
|
||||
onVisibleChange?: (visible: boolean) => void; // 菜单显示/隐藏回调
|
||||
}
|
||||
|
||||
const PublishMenu: React.FC<PublishMenuProps> = () => {
|
||||
const PublishMenu: React.FC<PublishMenuProps> = (props) => {
|
||||
const { onVisibleChange } = props;
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
|
||||
// 使用 useEffect 监听 isVisible 变化,确保所有情况都能触发回调
|
||||
useEffect(() => {
|
||||
onVisibleChange?.(isVisible);
|
||||
}, [isVisible, onVisibleChange]);
|
||||
const [aiImportVisible, setAiImportVisible] = useState(false);
|
||||
const userInfo = useUserInfo();
|
||||
const ntrpRef = useRef<{
|
||||
|
||||
Reference in New Issue
Block a user