0.0.2 • Published 1 year ago

zluav-action-filed v0.0.2

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

React + TypeScript + Vite

首页伸缩工具栏 action-field---> 原项目中Active组件

现在迁移过来,进行一个包的整理,将一些常用的组件进行封装,方便使用。

npm install

npm run dev

npm run build

目录结构

lib 存放组件库

调用方式

组件引入

import { ActionField } from 'zluav-action-filed'

样式引入

import 'zluav-action-filed/dist/style.css'

使用

// 显示隐藏 更新 updateIsHide 数据
const handleIsHideChange = (message: boolean) => {
    console.log(message, 'message')
    // 在这里写
    //      dispatch(updateIsHide(message));
  }

// 加载模型的,有问题
  const handleSwitchModeChange = (message: boolean) => {
    console.log(message, 'action')
  }
  
  // 用于获取右下角比例尺数据的
  // const mapScale = useAppSelector((state) => state.scene.mapRuler);
  const mapScale = 100
  return (
    <>
      <ActionField
          isHide={true}
          onIsHideChange={handleIsHideChange}
          onSwitchModeChange={handleSwitchModeChange}
          mapScale={mapScale}
      ></ActionField>
    </>
  )