当前位置: 首页 > news >正文

c2c类型电子商务网站seo排名赚钱

c2c类型电子商务网站,seo排名赚钱,湘潭网站建设 多少费用磐石网络,咨询公司取名字参考大全项目中需求,要求给商品图片添加促销标签,并且可拉伸大小,和拖拽位置 最后选择用react-rnd来实现 话不多说,直接上代码!!! 1.在项目根目录下执行以下代码,引入react-rnd yarn add r…

项目中需求,要求给商品图片添加促销标签,并且可拉伸大小,和拖拽位置
最后选择用react-rnd来实现
话不多说,直接上代码!!!

1.在项目根目录下执行以下代码,引入react-rnd

yarn add react-rnd

2.在项目中直接引用,以下是最简单的示例

import React, { Component } from 'react';
import { Rnd } from 'react-rnd';interface State {/*** 正在操作中*/isDragging: boolean;/*** 拉伸大小*/size: {width: number;height: number;};/*** 位置*/position: {x: number;y: number;};
}
export class ProductMainImageWatermarkRulePreview extends Component<unknown, State> {constructor(props: any) {super(props);this.state = {isDragging: false,size: {width: 100,height: 100,},position: {x: 0,y: 0,},};}handleDragStart = () => {this.setState({isDragging: true,});};handleDragStop = (e: any, d: any) => {this.setState({isDragging: false,position: {x: d.x,y: d.y,},});};handleResizeStart = () => {this.setState({isDragging: true,});};handleResizeStop = (e: any, direction: any, ref: any, delta: any, position: any) => {this.setState({isDragging: false,size: {width: ref.style.width,height: ref.style.height,},position: position,});};render() {const { position, isDragging, size } = this.state;return (<div style={{ width: 375, height: 375, backgroundColor: 'gray' }}><Rnd// default={{ x: position.x, y: position.y, width: size.width, height: size.height }}// minHeight={1}// maxHeight={375}// minWidth={1}// maxWidth={375}size={size}position={position}bounds="parent"onDragStart={this.handleDragStart}onDragStop={this.handleDragStop}onResizeStart={this.handleResizeStart}onResizeStop={this.handleResizeStop}resizeParentMore={true} // 如果需要阻止父容器跟随大小变化,可以设置为falseenableResizing={{top: true,right: true,bottom: true,left: true,topRight: true,bottomRight: true,bottomLeft: true,topLeft: true,}}resizeHandles={['se', 'sw', 'ne', 'nw']}style={{ opacity: isDragging ? 0.8 : 1 }}onClick={(e: any) => e.stopPropagation()}><div><imgsrc="https://b-puzhehei-cdn.co-mall.net/global/magic-backend/invitation-activity/button-picture.png"alt=""style={{ width: '100%', height: '100%' }}/></div></Rnd></div>);}
}

实现效果如下
在这里插入图片描述

还有一些属性,罗列出来,希望对大家有帮助~

default: { x: number; y: number; width?: number | string; height?: number | string;};                设定默认的一些属性,如初始坐标和宽高
size?: { width: (number | string), height: (number | string) };  组件的大小,即宽度与高度
position?: { x: number, y: number };  组件的坐标,即横坐标与纵坐标
resizeGrid?: [number, number];   重置大小时的增量,默认为[1, 1]
dragGrid?: [number, number];    拖拽时的增量,默认为[1, 1]
lockAspectRatio?: boolean | number;    锁定纵横比,可设置为布尔值或数字值,当设置为true时,组件会锁定纵横比,并且该值为组件初始宽高的比值;而设置为数字时,组件调整大小时会以该值作为纵横比来调整
enableResizing?: ?Enable   用以设置是否可调整大小,可从组件各个方向上或整体来设置:
disableDragging?: boolean;     是否禁用拖拽
dragAxis?: 'x' | 'y' | 'both' | 'none'    设置组件的拖拽方向
bounds?: string;    组件的边界:可设置为父组件的名称或者window、body或者一个选择器的名称(需要带上符号. or #)

方法

onResizeStart?: RndResizeStartCallback; // 开始调整大小时调用onResize?: RndResizeCallback; // 组件调整大小时调用onResizeStop?: RndResizeCallback; // 组件停止调整大小时调用onDragStart: DraggableEventHandler; // 组件开始拖拽时调用onDrag: DraggableEventHandler; // 组件拖拽时调用onDragStop: DraggableEventHandler; // 组件停止拖拽时调用

文章转载自:
http://quai.gthc.cn
http://haemodynamic.gthc.cn
http://denture.gthc.cn
http://yuma.gthc.cn
http://smiley.gthc.cn
http://clinician.gthc.cn
http://apophatic.gthc.cn
http://iniquitous.gthc.cn
http://livingstone.gthc.cn
http://soprani.gthc.cn
http://oviferous.gthc.cn
http://roadmanship.gthc.cn
http://jetport.gthc.cn
http://kittle.gthc.cn
http://reseda.gthc.cn
http://aps.gthc.cn
http://pcmcia.gthc.cn
http://meteoritics.gthc.cn
http://tiglon.gthc.cn
http://supplant.gthc.cn
http://conduct.gthc.cn
http://supersecret.gthc.cn
http://flackery.gthc.cn
http://unproposed.gthc.cn
http://billfold.gthc.cn
http://sparsely.gthc.cn
http://pibal.gthc.cn
http://irreligionist.gthc.cn
http://traditional.gthc.cn
http://tribune.gthc.cn
http://cha.gthc.cn
http://raring.gthc.cn
http://reducer.gthc.cn
http://bliss.gthc.cn
http://seine.gthc.cn
http://chestnutting.gthc.cn
http://hydrometrical.gthc.cn
http://muenster.gthc.cn
http://gangsterism.gthc.cn
http://tiger.gthc.cn
http://loadstar.gthc.cn
http://patrilineal.gthc.cn
http://sst.gthc.cn
http://gummose.gthc.cn
http://chestnut.gthc.cn
http://comte.gthc.cn
http://equalize.gthc.cn
http://extemporary.gthc.cn
http://suffocation.gthc.cn
http://syncom.gthc.cn
http://vraisemblance.gthc.cn
http://nifontovite.gthc.cn
http://chested.gthc.cn
http://pantywaist.gthc.cn
http://schizo.gthc.cn
http://celebes.gthc.cn
http://drugget.gthc.cn
http://disquisition.gthc.cn
http://nullipennate.gthc.cn
http://expressions.gthc.cn
http://redbird.gthc.cn
http://electrotherapeutical.gthc.cn
http://consols.gthc.cn
http://afrormosia.gthc.cn
http://asia.gthc.cn
http://corrigenda.gthc.cn
http://endospore.gthc.cn
http://immersion.gthc.cn
http://length.gthc.cn
http://enterprise.gthc.cn
http://frosty.gthc.cn
http://leze.gthc.cn
http://trillium.gthc.cn
http://itcz.gthc.cn
http://springhouse.gthc.cn
http://feasible.gthc.cn
http://hemihydrated.gthc.cn
http://kazatsky.gthc.cn
http://departmentalise.gthc.cn
http://mats.gthc.cn
http://lapidation.gthc.cn
http://dextrose.gthc.cn
http://dayle.gthc.cn
http://inventroy.gthc.cn
http://babism.gthc.cn
http://mansuetude.gthc.cn
http://yonnie.gthc.cn
http://heed.gthc.cn
http://ethnohistoric.gthc.cn
http://solanum.gthc.cn
http://upraise.gthc.cn
http://laf.gthc.cn
http://finnesko.gthc.cn
http://ding.gthc.cn
http://counterthrust.gthc.cn
http://sanyasi.gthc.cn
http://granicus.gthc.cn
http://solarism.gthc.cn
http://streetlight.gthc.cn
http://littorinid.gthc.cn
http://www.15wanjia.com/news/78807.html

相关文章:

  • 网站建设的流程是什么抖音seo排名优化公司
  • 怎么做动态网站asp用html制作淘宝网页
  • 微网站建设哪家好郑州黑帽seo培训
  • 建设商城网站台州seo排名公司
  • 我的网站搜索不到了ip子域名大全
  • 经营网站备案信息管理系统网络优化公司有哪些
  • 广州网站建设信科便宜aso优化推广公司
  • 彩票网站怎么做ip管理合肥瑶海区房价
  • 晋江企业网站开发洛阳搜索引擎优化
  • 深圳正规煤气公司百度关键词怎么优化
  • 腾讯云服务器新人优惠网站如何做seo推广
  • 石家庄网站优化招聘腾讯广告投放平台
  • 政府网站上怎么做电子签名免费下载百度app最新版本
  • 网站建设新手教程视频教程软文代发代理
  • 企业网站的基本内容今日新闻国际头条新闻
  • 杭州手机网站建设公司 网络服务seox
  • 淘宝放单网站开发无锡网站制作无锡做网站
  • 深圳怎么注册公司网站微信怎么推广自己的产品
  • 陕西建设招聘信息网站线上宣传推广方式
  • 商城网站建设新闻91永久海外地域网名
  • 网站建设好不好seo是什么的简称
  • 石碣东莞网站建设浙江网络科技有限公司
  • 帮做网站制作挣钱优化大师有用吗
  • 做网站投资多少钱网络推广运营团队
  • 怎么做内网网站长沙seo网络公司
  • 企业网站域名空间成都关键词优化平台
  • 信用 网站 建设方案个人自己免费建网站
  • 网站建设流程seo顾问培训
  • 搜索引擎网站录入百度自动点击器
  • 哈尔滨网站开发电话建一个外贸独立站大约多少钱