摘要:
注:三个页面A,B,C(B页面引入A,C页),A页面中的一个值传递给C页面实现方法 B页面代码: //B页面引入C <C ref="comRef" /> //B页面引入A <A getImg={(img) => { this.getImg(img) }} /> getImg(img) { this. 阅读全文
摘要:
/** * 时间戳转化为年 月 日 时 分 秒 * number: 传入时间戳 * format:返回格式,支持自定义,但参数必须与formateArr里保持一致 */ function formatTime(number,format) { var formateArr = ['Y','M','D 阅读全文
摘要:
import React, { Component } from 'react'; import { AppRegistry, StyleSheet, Text, View, Button } from 'react-native'; export default class HomeScreen 阅读全文
摘要:
import React, { Component } from 'react'; import { View, Text, Image, StyleSheet, TouchableOpacity, NativeModules, Platform, StatusBar, ScrollView, Al 阅读全文
摘要:
A页面向B页面传递参数: A页面代码如下: 事件方法toOrderDetail() toOrderDetail(item){ //this.props.navigation.push('跳转的目标页面', { 参数名: 参数值 }) this.props.navigation.push('B', { 阅读全文
摘要:
子组件A代码如下: 点击子组件事件(selectItem)获取所需传递的参数 selectItem(item, index) { this.props.getChildrenMsg(item.skill_name) this.props.callBack() } 父组件B代码如下: import A 阅读全文
摘要:
下载地址:https://nginx.org/en/download.html 下载下来会是一个解压包,解压到你想放的文件夹下 运行nginx.exe,然后打开浏览器输入localhost出来如下图片所示就说明成功了: 新增转发地址(后台请求地址) /api 上面是安装配置nginx服务器的方法,下 阅读全文
摘要:
法一 vue项目完成后npm run build会生成dist文件,此时直接将dist文件发布到线上即可,若想本地打开dist/index.html可看,一般页面为空,或者报错找不到css和js文件,则需要更改一些路径参数,改成相对当前目录,然后再次运行npm run build 就可以在本地打开i 阅读全文
摘要:
div跟随鼠标移动是依赖于鼠标移动事件(onmousemove),废话不多说直接上代码: CSS: <style> #div1{ width:50px; height:50px; border-radius:25px; background-color:rgba(0,0,0,0.5); cursor 阅读全文
摘要:
在项目中有这么一个需求,点击按钮复制一段文本,就像下图中的点击微信我们,弹出一个弹窗,点击好的跳转微信端添加好友。 法一:(clipboard.min.js) 需要使用到clipboard.min.js,下载链接:https://github.com/Superheroo/copy-text/tre 阅读全文