1.react初步准备工具安装,环境sublime text安装等

49 篇文章 6 订阅

资源

官方github:https://github.com/facebook/react/releases
官网:https://react.docschina.org/docs/getting-started.html
三个包下载:
https://cdn.staticfile.org/react/16.4.0/umd/react.development.js
https://cdn.staticfile.org/react-dom/16.4.0/umd/react-dom.development.js
https://unpkg.com/babel-standalone@6.15.0/babel.min.js
sublime text编辑器下载:http://www.onlinedown.net/soft/68602.htm
sublime text 使用说明:http://www.sublimetext.cn/docs/3/index.html
react教程:http://www.ruanyifeng.com/blog/2016/09/react-technology-stack.html

sublime Text安装汉化插件

  1. ctrl+`,控制台输入如下,回车
import urllib.request,os,hashlib; h = '6f4c264a24d933ce70df5dedcf1dcaee' + 'ebe013ee18cced0ef93d5f746d80ef60'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.cn/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
  1. 然后点setting-default,菜单在:
    【preferences——package settings——package control——settings-default】
    把此网址注释掉,改成.cn的网址,提高安装速度
  2. 再【preferences——package control】,找到里面的:移上去,回车
    在这里插入图片描述
  3. 再输入chinese…找到【Chinese​Localizations】移上去,回车。等等完成安装
"channels": [
		//"https://packagecontrol.io/channel_v3.json"
		"http://packagecontrol.cn/channel_v3.json"
	],

5.再菜单里【help——language——找到中文】选中,软件即变成汉化版

【问题】sublime Text插件初始化失败无法编辑Package Control.sublime-settings

问题: 内容可以看到但编辑不了,ctrl+~查看控制台可发现错误:Unable to open /C/Users/Administrator/AppData/Roaming/Sublime Text 3/Packages/Package Control/Package Control.sublime-settings
解决: 打开上目录,发现Package Control.sublime-settings文件及对应目录不存在,接下来建立一样目录和文件把下述代码拷进去,保存即可。
Package Control.sublime-settings内容:

{
	// A list of URLs that each contain a JSON file with a list of repositories.
	// The repositories from these channels are placed in order after the
	// repositories from the "repositories" setting
	"channels": [
		//"https://packagecontrol.io/channel_v3.json"
		"http://packagecontrol.cn/channel_v3.json"
	],

	// A list of URLs that contain a packages JSON file. These repositories
	// are placed in order before repositories from the "channels"
	// setting
	"repositories": [],

	// A list of packages to install pre-release versions for. Versions
	// under 1.0.0 are not considered pre-release, only those using the SemVer
	// -prerelease suffixes will be ignored if the package is not in this
	// list.
	"install_prereleases": [],

	// If debugging information for HTTP/HTTPS connections should be printed
	// to the Sublime Text console
	"debug": false,

	// This helps solve naming issues where a repository it not named the
	// same as the package should be. This is primarily only useful for
	// GitHub and BitBucket repositories. This mapping will override the
	// mapping that is retrieved from the repository channels.
	"package_name_map": {},

	// If package install, upgrade and removal info should be submitted to
	// the channel for aggregated statistics
	"submit_usage": true,

	// The URL to post install, upgrade and removal notices to
	"submit_url": "https://packagecontrol.io/submit",

	// If packages should be automatically upgraded when ST starts
	"auto_upgrade": true,

	// If missing packages should be automatically installed when ST starts
	"install_missing": true,

	// If a package was installed by Package Control (has a
	// package-metadata.json file) but is not in installed_packages, remove it
	// based upon the assumption that it was removed on another machine and
	// the Package Control.sublime-settings file was synced to this machine.
	"remove_orphaned": true,

	// The minimum frequency in hours in which to check for automatic upgrades,
	// setting this to 0 will always check for automatic upgrades
	"auto_upgrade_frequency": 1,

	// Packages to not auto upgrade
	"auto_upgrade_ignore": [],

	// Timeout for downloading channels, repositories and packages. Doesn't
	// have an effect on Windows due to a bug in WinINet.
	"timeout": 30,

	// The number of seconds to cache repository and package info for
	"cache_length": 300,

	// An HTTP proxy server to use for requests. Not normally used on Windows
	// since the system proxy configuration is utilized via WinINet. However,
	// if WinINet is not working properly, this will be used by the Urllib
	// downloader, which acts as a fallback.
	"http_proxy": "",
	// An HTTPS proxy server to use for requests - this will inherit from
	// http_proxy if it is set to "" or null and http_proxy has a value. You
	// can set this to false to prevent inheriting from http_proxy. Not
	// normally used on Windows since the system proxy configuration is
	// utilized via WinINet. However, if WinINet is not working properly, this
	// will be used by the Urllib downloader, which acts as a fallback.
	"https_proxy": "",

	// Username and password for both http_proxy and https_proxy. May be used
	// with WinINet to set credentials for system-level proxy config.
	"proxy_username": "",
	"proxy_password": "",

	// If HTTP responses should be cached to disk
	"http_cache": true,

	// Number of seconds to cache HTTP responses for, defaults to one week
	"http_cache_length": 604800,

	// User agent for HTTP requests. If "%s" is present, will be replaced
	// with the current version.
	"user_agent": "Package Control v%s",

	// A list of package names to ignore when performing operations. This will
	// only affect packages that appear to be a git or hg repository, but will
	// be especially useful for package developers who manually deal with the
	// repository and don't want Package Control touching it.
	//
	// It can help if trying to list packages to install hangs, possibly due
	// to an interactive prompt.
	//
	// The setting can also be set to the boolean true to ignore all git and hg
	// repositories, no matter what the name.
	"ignore_vcs_packages": [],

	// Custom path(s) to "git" binary for when it can't be automatically
	// found on the system and a package includes a .git metadata directory.
	// Supports more than one path to allow users to sync settings across
	// operating systems.
	"git_binary": [],

	// This should NOT contain the name of the remote or branch - that will
	// be automatically determined.
	"git_update_command": ["pull", "--ff", "--commit"],

	// Custom path(s) to "hg" binary for when it can't be automatically
	// found on the system and a package includes a .hg metadata directory.
	// Supports more than one path to allow users to sync settings across
	// operating systems.
	"hg_binary": [],

	// For HG repositories, be sure to use "default" as the remote URL.
	// This is the default behavior when cloning an HG repo.
	"hg_update_command": ["pull", "--update"],

	// Additional packages to ignore when listing unmanaged packages.
	"unmanaged_packages_ignore": [],

	// The downloader backends that should be used for HTTP(S) requests, split
	// by operating system to allow for configuration to be shared.
	//
	// Valid options include: "urllib", "curl", "wget", (Windows-only) "wininet"
	//
	// This setting allows Windows users to bypass wininet and use urllib
	// instead if they machine or network presents trouble to wininet. Some
	// OS X and Linux users have also reported better luck with certain proxies
	// using curl or wget instead of urllib.
	//
	// The "curl" and "wget" options require the command line "curl" or "wget"
	// program installed and present in the PATH.
	"downloader_precedence": {
		"windows": ["wininet"],
		"osx": ["urllib"],
		"linux": ["urllib", "curl", "wget"]
	},

	// Directories to ignore when creating a package
	"dirs_to_ignore": [
		".hg", ".git", ".svn", "_darcs", "CVS"
	],

	// Files to ignore when creating a package
	"files_to_ignore": [
		"*.pyc", ".hgignore", ".gitignore", ".bzrignore",
		"*.sublime-project", "*.sublime-workspace", "*.tmTheme.cache"
	],

	// Files to include, even if they match a pattern in files_to_ignore
	"files_to_include": [],

	// When a package is created, copy it to this folder - defaults to Desktop
	"package_destination": "",

	// A way to create different packaging profiles for different types of
	// package releases, such as for different platforms or binary-only
	// releases.
	//
	// The key of the object will be the profile name and a list of them will
	// be presenting when running the "Create Package File" command. The
	// profile "Default" will use the top-level version on the following
	// settings:
	//
	// - "dirs_to_ignore"
	// - "files_to_ignore"
	// - "files_to_include"
	// - "package_destination"
	//
	// If a profile does not include one of those three setting, it will fall
	// back to the top-level settings.
	"package_profiles": {
		"Binaries Only": {
			// Exclude all .py files, but consequently include all .pyc files
			"files_to_ignore": [
				"*.py", ".hgignore", ".gitignore", ".bzrignore",
				"*.sublime-project", "*.sublime-workspace", "*.tmTheme.cache"
			],

			// Include __init__.py so Sublime Text will load the package
			"files_to_include": [
				"__init__.py"
			]
		}
	},

	// Enable the ability to run the tests - this is only for development
	"enable_tests": false
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值