@netless/react-scale-controller
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

netless-scale-controller

a whiteboard scale controller

NPM JavaScript Style Guide

1. 说明

本项目技术选型为:React Typescript 打包工具为: rollup

2. 安装

npm install --save @netless/react-scale-controller"

或者

yarn add @netless/react-scale-controller"

3. 接口说明

参数 说明 类型 默认值
zoomScale 缩放比例 number
zoomChange 缩放变换回调 (scale: number) => void
style? 样式 (React.CSSProperties

4. 使用概览

import * as React from "react";
import ScaleController from "@netless/react-scale-controller";

export default class ScaleControllerExample extends React.Component<{}, {}> 
  render () {
    return (
        <ScaleController
            zoomScale={room.state.zoomScale}
            zoomChange={this.zoomChange}/>
    )
  }
}

5. 启动项目

  1. 获取源码

    git clone git@github.com:netless-io/netless-react-scale-controller.git
  2. 进入项目并安装库文件依赖

    cd netless-react-scale-controller
    yarn
  3. 启动库文件项目

        yarn start
  4. 进入项目并安装 example 文件依赖

        cd example
        yarn
  5. 启动 example 项目

        yarn start

5. 项目截图

scale-1-2-3

License

MIT © alwaysmavs

Dependents (4)

Package Sidebar

Install

npm i @netless/react-scale-controller

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

897 kB

Total Files

9

Last publish

Collaborators

  • vince-hz
  • alic_zhang
  • straybugs
  • moskize
  • netless-rick
  • yleaf
  • herewhite
  • cheerchen
  • l1shen
  • hyrious
  • huaguzheng