![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
react
aminsky0
坚持记录开发过程中的疑难点
展开
-
RN canvas绘制图片阴影
canvas绘制图片阴影效果引入react-native-canvasimport Canvas, { Image as CanvasImage } from “react-native-canvas”;数据data.js{ buseUrl: imgurl width: 206, height: 72, shadowColor: 'rgba(216, 165, 84, 0.29)', shadowOffsetY: 1原创 2022-04-17 17:57:59 · 984 阅读 · 3 评论 -
RN获取屏幕高宽、自适应(rem)设置
RN获取屏幕高宽、自适应(rem)设置1、引入Dimensions2、通过Dimensions.get(“window”).width/height; 获取屏幕高宽pxToDp自适应js文件:import {Dimensions} from 'react-native';// 获取竖屏模式的宽度const deviceWidthDp = Dimensions.get('window').width;// UI 默认给图是750const uiWidthPx = 750;//传入设计稿宽度原创 2022-04-01 13:02:42 · 2393 阅读 · 0 评论 -
React-Native时间进度条
React-Native时间进度条import React, {Component} from "react";import { StyleSheet, View, Text } from "react-native";import DataStore from "../DataStore";let timer // 全局定时器class TimeProgressLine extends React.Component { constructor(props) { sup原创 2022-03-08 13:35:46 · 1499 阅读 · 0 评论 -
react修改数组中某个参数值的方法
react修改数组中某个参数值的方法const currentPageVideoList=[...this.state.currentPageVideoList];this.setState({currentPageVideoList: currentPageVideoList.map((item, key)=> key==index?{...item, coverImg: this.state.defaultImg}:item)})...原创 2021-03-03 20:22:09 · 2220 阅读 · 2 评论 -
React引入less配置
React引入less配置一、yarn add less less-loader二、yarn eject打开react项目配置项webpack.config.js三、添加配置项可以仿照css配置添加const lessRegex = /\.less$/;const lessModuleRegex = /\.module\.less$/;四、修改getStyleLoaders函数,添加代码 { loader: require.resolve("less-loader"), o原创 2020-11-10 17:13:51 · 371 阅读 · 0 评论 -
React16+antd项目的搭建及相关配置
React16+antd项目的搭建及相关配置原创 2020-02-24 13:47:02 · 402 阅读 · 0 评论