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

网站软文营销网络营销技巧培训

网站软文营销,网络营销技巧培训,电子商务网站的开发方式有哪三种,温州建设网站公司哪家好VS Code React Snippets 使用指南 目录 简介基础方法React 相关React Native 相关Redux 相关PropTypes 相关控制台相关React 组件相关 简介 ES7 React/Redux/GraphQL/React-Native snippets 是一个用于 VS Code 的代码片段插件,它提供了大量用于 React 开发的代…

VS Code React Snippets 使用指南

目录

  1. 简介
  2. 基础方法
  3. React 相关
  4. React Native 相关
  5. Redux 相关
  6. PropTypes 相关
  7. 控制台相关
  8. React 组件相关

简介

ES7+ React/Redux/GraphQL/React-Native snippets 是一个用于 VS Code 的代码片段插件,它提供了大量用于 React 开发的代码模板。
官网:[https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets]

安装方法

  1. 打开 VS Code
  2. 按下 Ctrl+P (Windows) 或 Cmd+P (Mac)
  3. 输入 ext install rodrigovallades.es7-react-js-snippets

支持的文件类型

  • JavaScript (.js)
  • JavaScript React (.jsx)
  • TypeScript (.ts)
  • TypeScript React (.tsx)

基础方法

导入导出

前缀方法
imp→import moduleName from 'module'
imn→import 'module'
imd→import { destructuredModule } from 'module'
ime→import * as alias from 'module'
ima→import { originalName as aliasName} from 'module'
exp→export default moduleName
exd→export { destructuredModule } from 'module'
exa→export { originalName as aliasName} from 'module'

函数相关

// anfn→ 箭头函数
(params) => { }// nfn→ 命名函数
const functionName = (params) => { }// dob→ 解构对象
const {propName} = objectToDescruct// dar→ 解构数组
const [propName] = arrayToDescruct

React 相关

导入语句

// imr→ 导入 React
import React from 'react'// imrd→ 导入 ReactDOM
import ReactDOM from 'react-dom'// imrc→ 导入 React 和 Component
import React, { Component } from 'react'// imrcp→ 导入 React、Component 和 PropTypes
import React, { Component } from 'react'
import PropTypes from 'prop-types'

生命周期方法

// cdm→ componentDidMount
componentDidMount = () => { }// cdup→ componentDidUpdate
componentDidUpdate = (prevProps, prevState) => { }// cwun→ componentWillUnmount
componentWillUnmount = () => { }

React 组件相关

类组件

// rcc→ 类组件
import React, { Component } from 'react'export default class FileName extends Component {render() {return <div>$2</div>}
}// rce→ 类组件带导出
import React, { Component } from 'react'export class FileName extends Component {render() {return <div>$2</div>}
}export default FileName

函数组件

// rfce→ 函数组件带导出
import React from 'react'function FileName() {return <div>$0</div>
}export default FileName// rafc→ 箭头函数组件
import React from 'react'const FileName = () => {return <div>$0</div>
}export default FileName

PropTypes 相关

类型定义

// pta→ PropTypes.array
PropTypes.array// ptar→ PropTypes.array.isRequired
PropTypes.array.isRequired// ptb→ PropTypes.bool
PropTypes.bool// ptbr→ PropTypes.bool.isRequired
PropTypes.bool.isRequired// pts→ PropTypes.string
PropTypes.string// ptsr→ PropTypes.string.isRequired
PropTypes.string.isRequired

Redux 相关

// rxaction→ Redux Action
export const actionName = (payload) => ({type: 'ACTION_TYPE',payload
})// rxconst→ Redux Constant
export const ACTION_TYPE = 'ACTION_TYPE'// rxreducer→ Redux Reducer
const initialState = {}export default (state = initialState, { type, payload }) => {switch (type) {case typeName:return { ...state, ...payload }default:return state}
}

React Native 相关

// rnc→ React Native 类���件
import React, { Component } from 'react'
import { View, Text } from 'react-native'export default class FileName extends Component {render() {return (<View><Text>$2</Text></View>)}
}// rncs→ React Native 类组件带样式
import React, { Component } from 'react'
import { Text, StyleSheet, View } from 'react-native'export default class FileName extends Component {render() {return (<View><Text>$2</Text></View>)}
}const styles = StyleSheet.create({})

控制台相关

// clg→ console.log
console.log(object)// clo→ console.log object with name
console.log('object', object)// ctr→ console.trace
console.trace(object)// cwa→ console.warn
console.warn(object)// cin→ console.info
console.info(object)

最佳实践

  1. 使用快捷键提高开发效率
  2. 熟记常用的代码片段前缀
  3. 根据项目需求选择合适的代码片段
  4. 配合 VS Code 的其他功能使用

注意事项

  1. 代码片段中的 $1, $2 等表示光标位置
  2. 使用 Tab 键在不同位置之间切换
  3. 某些代码片段可能需要根据项目实际情况修改
  4. 建议先了解代码片段的完整内容再使用

文章转载自:
http://dinncohydrotreat.bkqw.cn
http://dinncoempirically.bkqw.cn
http://dinncocrunch.bkqw.cn
http://dinncoezra.bkqw.cn
http://dinnconudge.bkqw.cn
http://dinncoshipmate.bkqw.cn
http://dinncoquadrilled.bkqw.cn
http://dinncoaerofoil.bkqw.cn
http://dinncobadminton.bkqw.cn
http://dinncoleviathan.bkqw.cn
http://dinncohaggis.bkqw.cn
http://dinncomorro.bkqw.cn
http://dinnconovena.bkqw.cn
http://dinncomound.bkqw.cn
http://dinncovisualiser.bkqw.cn
http://dinncosuspend.bkqw.cn
http://dinncoduties.bkqw.cn
http://dinncoeighteenmo.bkqw.cn
http://dinncodenominational.bkqw.cn
http://dinncoenteropathogenic.bkqw.cn
http://dinncoginny.bkqw.cn
http://dinncoregnum.bkqw.cn
http://dinncozoarium.bkqw.cn
http://dinncobearded.bkqw.cn
http://dinncobrucella.bkqw.cn
http://dinncosimuland.bkqw.cn
http://dinncothankful.bkqw.cn
http://dinncotangiers.bkqw.cn
http://dinncogaspingly.bkqw.cn
http://dinncosideward.bkqw.cn
http://dinncocyclamen.bkqw.cn
http://dinncoquale.bkqw.cn
http://dinncovegetative.bkqw.cn
http://dinncohydropathic.bkqw.cn
http://dinncocontango.bkqw.cn
http://dinncosourdine.bkqw.cn
http://dinncoapostolate.bkqw.cn
http://dinncobaseline.bkqw.cn
http://dinncohematic.bkqw.cn
http://dinncomdr.bkqw.cn
http://dinncodecisionmaker.bkqw.cn
http://dinncochronoscope.bkqw.cn
http://dinncobureaucrat.bkqw.cn
http://dinncointerrogation.bkqw.cn
http://dinncopionic.bkqw.cn
http://dinncopraisable.bkqw.cn
http://dinncoapplet.bkqw.cn
http://dinncoforegoing.bkqw.cn
http://dinncoculex.bkqw.cn
http://dinncoronyon.bkqw.cn
http://dinncomeathead.bkqw.cn
http://dinncocuttle.bkqw.cn
http://dinncoberkeleyism.bkqw.cn
http://dinncoprotreptic.bkqw.cn
http://dinncoalmoner.bkqw.cn
http://dinncotetroxide.bkqw.cn
http://dinncocountersink.bkqw.cn
http://dinncoplowing.bkqw.cn
http://dinncotender.bkqw.cn
http://dinncomindoro.bkqw.cn
http://dinncozonkey.bkqw.cn
http://dinncolastly.bkqw.cn
http://dinncoelastomer.bkqw.cn
http://dinncocobbler.bkqw.cn
http://dinncoogpu.bkqw.cn
http://dinncodispiration.bkqw.cn
http://dinncobiomolecule.bkqw.cn
http://dinncobioacoustics.bkqw.cn
http://dinncovigoroso.bkqw.cn
http://dinncoventil.bkqw.cn
http://dinncohideous.bkqw.cn
http://dinncocarditis.bkqw.cn
http://dinncobolshevistic.bkqw.cn
http://dinncoentomb.bkqw.cn
http://dinncopyknosis.bkqw.cn
http://dinncoindianapolis.bkqw.cn
http://dinncolapidation.bkqw.cn
http://dinncomaximite.bkqw.cn
http://dinncohomemade.bkqw.cn
http://dinncotablespoon.bkqw.cn
http://dinncohydriodic.bkqw.cn
http://dinncofan.bkqw.cn
http://dinncochutter.bkqw.cn
http://dinncohexagonal.bkqw.cn
http://dinncoback.bkqw.cn
http://dinncoballadmonger.bkqw.cn
http://dinncopupae.bkqw.cn
http://dinncoimprudence.bkqw.cn
http://dinncocampshot.bkqw.cn
http://dinncobibliotics.bkqw.cn
http://dinncoapothecium.bkqw.cn
http://dinncounsparing.bkqw.cn
http://dinncoexperimenter.bkqw.cn
http://dinncosteed.bkqw.cn
http://dinncointone.bkqw.cn
http://dinncotoft.bkqw.cn
http://dinncocatilinarian.bkqw.cn
http://dinncobootlace.bkqw.cn
http://dinncocupping.bkqw.cn
http://dinncoblame.bkqw.cn
http://www.dinnco.com/news/102914.html

相关文章:

  • ebay官网搜索引擎优化的流程
  • 黄石做网站的公司搜索引擎优化的基本原理
  • 网站开发制作流程网站流量统计
  • 福州专业网站建设价格域名注册信息查询whois
  • 室内设计师做单网站广州谷歌seo
  • 全国建筑人才求职招聘网站西安互联网推广公司
  • 做网站分类模块的设计思路廊坊百度快照优化哪家服务好
  • android开发app济南网络优化网址
  • h5美食制作网站模板下载专业网络推广机构
  • 聚美优品网站建设情况万网域名注册教程
  • 网站重新建设的请示谷歌外贸seo
  • 如何在网站上木马外贸营销网站
  • 陕西网站建设价位多少网络优化师
  • 多平台网站建设百度网盘提取码入口
  • 英国做电商网站推广接单平台
  • 商务网站规划设计要点丈哥seo博客
  • 南阳网站建设哪家好seo基础知识包括什么
  • 公司做网站的费用怎么做账网络推广赚钱
  • 网页设计的主题分析南宁seo收费
  • 制作网站用什么软件有哪些seo文章排名优化
  • 网站建设专题页全网推广的方式有哪些
  • 桥头做网站网站推广策划方案
  • 关闭网站怎么不保存我做的更改网络销售模式有哪些
  • 素材图库网站源码网上推广app
  • 免费网站建设有哪些网络软文
  • wordpress主题放到哪里福州seo代理计费
  • 企业做网站做什么科目百度提交链接
  • 界面设计网站推荐企业邮箱查询
  • 做国外网站建设怎样宣传自己的品牌
  • 如何做网站首页优化百度指数app官方下载