vue目錄結構

vue目錄結構

  • 參考一
  • 參考二
  • 參考三

參考一

目錄一級二級
bulid項目構建的一些 js 文件
config配置文件項,index.js 比較重要,打包上線需要修改配置
dist項目打包后的文件
node_modulesnpm安裝包位置
src項目的開發目錄
-assets圖片、字體等資源
-components公共組件部分
-config開發分支和生產分支的切換配置,以及 fetch.js 對于前后臺數據交互的封裝
-plugin第三方插件
-views頁面部分
-serverajax、axios等請求數據集中處理
-router路由
-store狀態管理
-App.vue項目入口文件,我們也可以直接將組建寫這里,而不使用 components 目錄
-main.js項目的核心文件
index.htmlhtml文件
test測試項目
package.json項目配置項文件

參考二

基礎庫: vue.js、vue-router、vuex、whatwg-fetch
編譯/打包工具:webpack、babel、node-sass
單元測試工具:karma、mocha、sinon-chai
本地服務器:express目錄結構
README.md            項目介紹
index.html           入口頁面
build                構建腳本目錄build-server.js           運行本地構建服務器,可以訪問構建后的頁面build.js                  生產環境構建腳本dev-client.js             開發服務器熱重載腳本,主要用來實現開發階段的頁面自動刷新dev-server.js          	  運行本地開發服務器utils.js                  構建相關工具方法webpack.base.conf.js      wabpack基礎配置webpack.dev.conf.js       wabpack開發環境配置webpack.prod.conf.js      wabpack生產環境配置
config                	   項目配置dev.env.js             開發環境變量index.js               項目配置文件prod.env.js            生產環境變量test.env.js            測試環境變量
mock              	 	   mock數據目錄hello.js
package.json          	   npm包配置文件,里面定義了項目的npm腳本,依賴包等信息
src                        源碼目錄 main.js                入口js文件app.vue                根組件components             公共組件目錄title.vueassets                 資源目錄,這里的資源會被wabpack構建imageslogo.pngroutes         	       前端路由index.jsstore                  應用級數據(state)index.jsviews                  頁面目錄hello.vue
static             		   純靜態資源,不會被wabpack構建。
test              		   測試文件目錄(unit&e2e)unit              	   單元測試index.js           入口腳本karma.conf.js          karma配置文件specs                  單測case目錄Hello.spec.js

參考三

1.build文件夾
(1)build.js'use strict'                                    // js的嚴格模式
require('./check-versions')()                   // node和npm的版本檢查process.env.NODE_ENV = 'production'             // 設置環境變量為生產環境// 導進各模塊
const ora = require('ora') // loading模塊
const rm = require('rimraf') // 用于刪除文件
const path = require('path') // 文件路徑工具
const chalk = require('chalk') // 在終端輸出帶顏色的文字
const webpack = require('webpack') // 引入webpack.js
const config = require('../config') // 引入配置文件
const webpackConfig = require('./webpack.prod.conf') // 引入生產環境配置文件
// 在終端顯示loading效果, 并輸出提示
const spinner = ora('building for production...')
spinner.start()/*rm方法刪除dist/static文件夾若刪除中有錯誤則拋出異常并終止程序若沒有錯誤則繼續執行,構建webpack結束動畫若有異常則拋出標準輸出流,類似于console.log
*/
rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {if (err) throw errwebpack(webpackConfig, (err, stats) => {spinner.stop()if (err) throw errprocess.stdout.write(stats.toString({colors: true,                     // 增加控制臺顏色開關modules: false,                   // 是否增加內置模塊信息children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.chunks: false,                    // 允許較少的輸出chunkModules: false               // 不將內置模塊信息加到包信息}) + '\n\n')                        // 編譯過程持續打印// 編譯出錯的信息if (stats.hasErrors()) {console.log(chalk.red('  Build failed with errors.\n'))process.exit(1)}// 編譯成功的信息console.log(chalk.cyan('  Build complete.\n'))console.log(chalk.yellow('  Tip: built files are meant to be served over an HTTP server.\n' +'  Opening index.html over file:// won\'t work.\n'))})
})(2)check-versions.js     node和npm的版本檢測, 實現版本依賴
'use strict'                                            // js的嚴格模式// 導進各模塊
const chalk = require('chalk')
const semver = require('semver') // 檢測版本
const packageConfig = require('../package.json')
const shell = require('shelljs') // shell.js插件,執行unix系統命令function exec (cmd) {// 腳本可以通過child_process模塊新建子進程,從而執行Unix系統命令// 將cmd參數傳遞的值轉換成前后沒有空格的字符串,也就是版本號return require('child_process').execSync(cmd).toString().trim()
}//聲明常量數組,數組內容為有關node相關信息的對象
const versionRequirements = [{name: 'node',                                       //對象名稱為nodecurrentVersion: semver.clean(process.version),      //使用semver插件,把版本信息轉換成規定格式versionRequirement: packageConfig.engines.node      //規定package.json中engines選項的node版本信息}
]if (shell.which('npm')) {                               //which為linux指令,在$path規定的路徑下查找符合條件的文件versionRequirements.push({name: 'npm',currentVersion: exec('npm --version'),              //調用npm --version命令,并且把參數返回給exec函數獲取純凈版本versionRequirement: packageConfig.engines.npm       //規定package.json中engines選項的node版本信息})
}module.exports = function () {const warnings = []for (let i = 0; i < versionRequirements.length; i++) {const mod = versionRequirements[i]// 如果版本號不符合package.json文件中指定的版本號,就執行warning.push...// 當前版本號用紅色標識,要求版本號用綠色標識if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {warnings.push(mod.name + ': ' +chalk.red(mod.currentVersion) + ' should be ' +chalk.green(mod.versionRequirement))}}//如果為真,則打印提示用戶升級新版本if (warnings.length) {console.log('')console.log(chalk.yellow('To use this template, you must update following to modules:'))console.log()for (let i = 0; i < warnings.length; i++) {const warning = warnings[i]console.log('  ' + warning)}console.log()process.exit(1)}
}(3)utils.js   utils是工具的意思,是一個用來處理css的文件,這個文件包含了三個工具函數:
生成靜態資源的路徑
生成 ExtractTextPlugin對象或loader字符串
生成 style-loader的配置
'use strict'
const path = require('path')
const config = require('../config')                                 // 引入config下的index.js文件
const ExtractTextPlugin = require('extract-text-webpack-plugin')    // 一個插件,抽離css樣式,防止將樣式打包在js中引起樣式加載錯亂
const packageConfig = require('../package.json')
// 導出assetsPath
/** @method assertsPath 生成靜態資源的路徑(判斷開發環境和生產環境,為config文件中index.js文件中定義assetsSubDirectory)* @param {String}  _path 相對于靜態資源文件夾的文件路徑* @return {String}     靜態資源完整路徑*/
exports.assetsPath = function (_path) {const assetsSubDirectory = process.env.NODE_ENV === 'production'? config.build.assetsSubDirectory: config.dev.assetsSubDirectory
//nodeJs path提供用于處理文件路徑的工具;path.posix提供對路徑方法的POSIX(可移植性操作系統接口)特定實現的訪問(可跨平臺); path.posix.join與path.join一樣,不過總是以 posix 兼容的方式交互return path.posix.join(assetsSubDirectory, _path)                 // path.join返回絕對路徑(在電腦上的實際位置);path.posix.join返回相對路徑
}/**@method cssLoaders 生成處理css的loaders配置,使用css-loader和postcssLoader,通過options.usePostCSS屬性來判斷是否使用postcssLoader中壓縮等方法* @param {Object} option = {sourceMap: true,// 是否開啟 sourceMapextract: true // 是否提取css}生成配置* @return {Object} 處理css的loaders配置對象*/
exports.cssLoaders = function (options) {options = options || {}const cssLoader = {loader: 'css-loader',options: {sourceMap: options.sourceMap}}const postcssLoader = {loader: 'postcss-loader',options: {sourceMap: options.sourceMap}}// generate loader string to be used with extract text plugin/**@method generateLoaders 生成 ExtractTextPlugin對象或loader字符串* @param {Array}    loaders loader名稱數組* @return {String|Object}    ExtractTextPlugin對象或loader字符串*/function generateLoaders (loader, loaderOptions) {const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]if (loader) {loaders.push({loader: loader + '-loader',options: Object.assign({}, loaderOptions, {sourceMap: options.sourceMap})})}// ExtractTextPlugin提取css(當上面的loaders未能正確引入時,使用vue-style-loader)if (options.extract) {// 生產環境中,默認為truereturn ExtractTextPlugin.extract({use: loaders,fallback: 'vue-style-loader'})} else {//返回vue-style-loader連接loaders的最終值return ['vue-style-loader'].concat(loaders)}}// https://vue-loader.vuejs.org/en/configurations/extract-css.htmlreturn {css: generateLoaders(),//需要css-loader 和 vue-style-loaderpostcss: generateLoaders(),//需要css-loader、postcssLoader 和 vue-style-loaderless: generateLoaders('less'),//需要less-loader 和 vue-style-loadersass: generateLoaders('sass', { indentedSyntax: true }),//需要sass-loader 和 vue-style-loaderscss: generateLoaders('sass'),//需要sass-loader 和 vue-style-loaderstylus: generateLoaders('stylus'),//需要stylus-loader 和 vue-style-loaderstyl: generateLoaders('stylus')//需要stylus-loader 和 vue-style-loader}
}/**@method styleLoaders 生成 style-loader的配置* @param {Object}   options 生成配置* @return {Array}   style-loader的配置*/
exports.styleLoaders = function (options) {const output = []const loaders = exports.cssLoaders(options)
//將各種css,less,sass等綜合在一起得出結果輸出outputfor (const extension in loaders) {const loader = loaders[extension]output.push({test: new RegExp('\\.' + extension + '$'),use: loader})}return output
}exports.createNotifierCallback = () => {const notifier = require('node-notifier')return (severity, errors) => {if (severity !== 'error') returnconst error = errors[0]const filename = error.file && error.file.split('!').pop()notifier.notify({title: packageConfig.name,message: severity + ': ' + error.name,subtitle: filename || '',icon: path.join(__dirname, 'logo.png')})}
}(4)vue-loader.conf.js 處理.vue文件,解析這個文件中的每個語言塊(template、script、style),轉換成js可用的js模塊
'use strict'
const utils = require('./utils')
const config = require('../config')
const isProduction = process.env.NODE_ENV === 'production'
//生產環境,提取css樣式到單獨文件
const sourceMapEnabled = isProduction? config.build.productionSourceMap: config.dev.cssSourceMap
module.exports = {loaders: utils.cssLoaders({sourceMap: sourceMapEnabled,extract: isProduction}),cssSourceMap: sourceMapEnabled,cacheBusting: config.dev.cacheBusting,//編譯時將“引入路徑”轉換為require調用,使其可由webpack處理transformToRequire: {video: ['src', 'poster'],source: 'src',img: 'src',image: 'xlink:href'}
}(5)webpack.base.conf.js:開發、測試、生產環境的公共基礎配置文件,配置輸出環境,配置模塊resolve和插件等
'use strict'
const path = require('path')// node自帶的文件路徑工具
const utils = require('./utils')// 工具函數集合
const config = require('../config')// 配置文件
const vueLoaderConfig = require('./vue-loader.conf')// 工具函數集合
/*** 獲取"絕對路徑"* @method resolve* @param {String} dir 相對于本文件的路徑* @return {String}   絕對路徑*/
function resolve(dir) {return path.join(__dirname, '..', dir)
}module.exports = {context: path.resolve(__dirname, '../'),//入口js文件(默認為單頁面所以只有app一個入口)entry: {app: './src/main.js'},//配置出口output: {path: config.build.assetsRoot,//打包編譯的根路徑(dist)filename: '[name].js',publicPath: process.env.NODE_ENV === 'production'? config.build.assetsPublicPath: config.dev.assetsPublicPath//發布路徑},resolve: {extensions: ['.js', '.vue', '.json'],// 自動補全的擴展名//別名配置alias: {'vue$': 'vue/dist/vue.esm.js','@': resolve('src'),// eg:"src/components" => "@/components"}},module: {rules: [//使用vue-loader將vue文件編譯轉換為js{test: /\.vue$/,loader: 'vue-loader',options: vueLoaderConfig},//通過babel-loader將ES6編譯壓縮成ES5{test: /\.js$/,loader: 'babel-loader',include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]},//使用url-loader處理(圖片、音像、字體),超過10000編譯成base64{test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,loader: 'url-loader',options: {limit: 10000,name: utils.assetsPath('img/[name].[hash:7].[ext]')}},{test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,loader: 'url-loader',options: {limit: 10000,name: utils.assetsPath('media/[name].[hash:7].[ext]')}},{test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,loader: 'url-loader',options: {limit: 10000,name: utils.assetsPath('fonts/[name].[hash:7].[ext]')}}]},//nodeJs全局變量/模塊,防止webpack注入一些nodeJs的東西到vue中node: {setImmediate: false,dgram: 'empty',fs: 'empty',net: 'empty',tls: 'empty',child_process: 'empty'}
}6)webpack.dev.conf.js:webpack配置開發環境中的入口
'use strict'
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')//webpack-merge實現合并
const path = require('path')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')//webpack的提示錯誤和日志信息的插件
const portfinder = require('portfinder')// 查看空閑端口位置,默認情況下搜索8000這個端口const HOST = process.env.HOST
const PORT = process.env.PORT && Number(process.env.PORT)const devWebpackConfig = merge(baseWebpackConfig, {module: {rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })},devtool: config.dev.devtool,//調試模式devServer: {clientLogLevel: 'warning',historyApiFallback: {//使用 HTML5 History API 時, 404 響應替代為 index.htmlrewrites: [{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },],},hot: true,//熱重載contentBase: false, // 提供靜態文件訪問compress: true,//壓縮host: HOST || config.dev.host,port: PORT || config.dev.port,open: config.dev.autoOpenBrowser,//npm run dev 時自動打開瀏覽器overlay: config.dev.errorOverlay? { warnings: false, errors: true }: false,// 顯示warning 和 error 信息publicPath: config.dev.assetsPublicPath,proxy: config.dev.proxyTable,//api代理quiet: true, //控制臺打印警告和錯誤(用FriendlyErrorsPlugin 為 true)watchOptions: {// 檢測文件改動poll: config.dev.poll,}},plugins: [new webpack.DefinePlugin({'process.env': require('../config/dev.env')}),new webpack.HotModuleReplacementPlugin(),//模塊熱替換插件,修改模塊時不需要刷新頁面new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.new webpack.NoEmitOnErrorsPlugin(),//webpack編譯錯誤的時候,中斷打包進程,防止錯誤代碼打包到文件中// 將打包編譯好的代碼插入index.htmlnew HtmlWebpackPlugin({filename: 'index.html',template: 'index.html',inject: true}),// 提取static assets 中css 復制到dist/static文件new CopyWebpackPlugin([{from: path.resolve(__dirname, '../static'),to: config.dev.assetsSubDirectory,ignore: ['.*']//忽略.*的文件}])]
})module.exports = new Promise((resolve, reject) => {portfinder.basePort = process.env.PORT || config.dev.portportfinder.getPort((err, port) => { //查找端口號if (err) {reject(err)} else {//端口被占用時就重新設置evn和devServer的端口process.env.PORT = portdevWebpackConfig.devServer.port = port// npm run dev成功的友情提示devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({compilationSuccessInfo: {messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],},onErrors: config.dev.notifyOnErrors? utils.createNotifierCallback(): undefined}))resolve(devWebpackConfig)}})
})7)webpack.dev.prod.js:webpack配置生產環境中的入口'use strict'
const path = require('path')
const utils = require('./utils')
const webpack = require('webpack')
const config = require('../config')
const merge = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')const env = require('../config/prod.env')const webpackConfig = merge(baseWebpackConfig, {module: {rules: utils.styleLoaders({sourceMap: config.build.productionSourceMap,extract: true,usePostCSS: true})},devtool: config.build.productionSourceMap ? config.build.devtool : false,//是否開啟調試模式output: {path: config.build.assetsRoot,filename: utils.assetsPath('js/[name].[chunkhash].js'),chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')},plugins: [new webpack.DefinePlugin({'process.env': env}),new UglifyJsPlugin({//壓縮jsuglifyOptions: {compress: {warnings: false}},sourceMap: config.build.productionSourceMap,parallel: true}),new ExtractTextPlugin({//提取靜態文件,減少請求filename: utils.assetsPath('css/[name].[contenthash].css'),allChunks: true,}),new OptimizeCSSPlugin({//提取優化壓縮后(刪除來自不同組件的冗余代碼)的csscssProcessorOptions: config.build.productionSourceMap? { safe: true, map: { inline: false } }: { safe: true }}),new HtmlWebpackPlugin({ //html打包壓縮到index.htmlfilename: config.build.index,template: 'index.html',inject: true,minify: {removeComments: true,//刪除注釋collapseWhitespace: true,//刪除空格removeAttributeQuotes: true//刪除屬性的引號},chunksSortMode: 'dependency'//模塊排序,按照我們需要的順序排序}),new webpack.HashedModuleIdsPlugin(),new webpack.optimize.ModuleConcatenationPlugin(),new webpack.optimize.CommonsChunkPlugin({  // node_modules中的任何所需模塊都提取到vendorname: 'vendor',minChunks (module) {return (module.resource &&/\.js$/.test(module.resource) &&module.resource.indexOf(path.join(__dirname, '../node_modules')) === 0)}}),new webpack.optimize.CommonsChunkPlugin({name: 'manifest',minChunks: Infinity}),new webpack.optimize.CommonsChunkPlugin({name: 'app',async: 'vendor-async',children: true,minChunks: 3}),new CopyWebpackPlugin([//復制static中的靜態資源(默認到dist里面){from: path.resolve(__dirname, '../static'),to: config.build.assetsSubDirectory,ignore: ['.*']}])]
})if (config.build.productionGzip) {const CompressionWebpackPlugin = require('compression-webpack-plugin')webpackConfig.plugins.push(new CompressionWebpackPlugin({asset: '[path].gz[query]',algorithm: 'gzip',test: new RegExp('\\.(' +config.build.productionGzipExtensions.join('|') +')$'),threshold: 10240,minRatio: 0.8}))
}if (config.build.bundleAnalyzerReport) {const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPluginwebpackConfig.plugins.push(new BundleAnalyzerPlugin())
}module.exports = webpackConfig2.config文件夾
(1) dev.env.js和prod.env.js:分別配置:開發環境和生產環境。這個可以根據公司業務結合后端需求配置需要區分開發環境和測試環境的屬性
'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')module.exports = merge(prodEnv, {NODE_ENV: '"development"'
})ps:webpack-merge用于實現合并類似于ES6的Object.assign()'use strict'
module.exports = {NODE_ENV: '"production"'
}*注意屬性值要用“‘'”雙層引住),訪問(獲取值)時直接用:process.env.屬性名ps:process(進程)是nodejs的一個全局變量,process.env 屬性返回一個用戶環境信息的對象(2)index.js配置解析:'use strict';
const path = require('path');module.exports = {// ===================開發環境配置dev: {assetsSubDirectory: 'static',//靜態資源文件夾(一般存放css、js、image等文件)assetsPublicPath: '/',//根目錄proxyTable: {},//配置API代理,可利用該屬性解決跨域的問題host: 'localhost', // 可以被 process.env.HOST 覆蓋port: 3030, // 可以被 process.env.PORT 覆蓋autoOpenBrowser: true,//編譯后自動打開瀏覽器頁面 http://localhost:3030/("port + host",默認"false"),設置路由重定向自動打開您的默認頁面errorOverlay: true,//瀏覽器錯誤提示notifyOnErrors: true,//跨平臺錯誤提示poll: false, //webpack提供的使用文件系統(file system)獲取文件改動的通知devServer.watchOptions(監控文件改動)devtool: 'cheap-module-eval-source-map',//webpack提供的用來調試的模式,有多個不同值代表不同的調試模式cacheBusting: true,// 配合devtool的配置,當給文件名插入新的hash導致清除緩存時是否生成source-mapcssSourceMap: true //記錄代碼壓縮前的位置信息,當產生錯誤時直接定位到未壓縮前的位置,方便調試},// ========================生產環境配置build: {index: path.resolve(__dirname, '../dist/index.html'),//編譯后"首頁面"生成的絕對路徑和名字assetsRoot: path.resolve(__dirname, '../dist'),//打包編譯的根路徑(默認dist,存放打包壓縮后的代碼)assetsSubDirectory: 'static',//靜態資源文件夾(一般存放css、js、image等文件)assetsPublicPath: '/',//發布的根目錄(dist文件夾所在路徑)productionSourceMap: true,//是否開啟source-mapdevtool: '#source-map',//(詳細參見:https://webpack.docschina.org/configuration/devtool)productionGzip: false,//是否壓縮productionGzipExtensions: ['js', 'css'],//unit的gzip命令用來壓縮文件(gzip模式下需要壓縮的文件的擴展名有js和css)bundleAnalyzerReport: process.env.npm_config_report //是否開啟打包后的分析報告}
};3、node_modules文件夾:
存放npm install時根據package.json配置生成的npm安裝包的文件夾4、src文件夾:
我們需要在src文件夾中開發代碼,打包時webpack會根據build中的規則(build規則依賴于config中的配置)將src打包壓縮到dist文件夾在瀏覽器中運行
(1)assets文件:用于存放靜態資源(css、image),assets打包時路徑會經過webpack中的file-loader編譯(因此,assets需要使用絕對路徑)成js
(2)components文件夾:用來存放 .vue 組件(實現復用等功能,如:過濾器,列表項等)3)router文件夾:在router/index.js文件中配置頁面路由
(4)App.vue:是整個項目的主組件,所有頁面都是通過使用<router-view/>開放入口在App.vue下進行切換的(所有的路由都是App.vue的子組件)
(5)main.js:入口js文件(全局js,你可以在這里:初始化vue實例、require/import需要的插件、注入router路由、引入store狀態管理)5static文件夾:
webpack默認存放靜態資源(css、image)的文件夾,與assets不同的是:static在打包時會直接復制一個同名文件夾到dist文件夾里(不會經過編譯,可使用相對路徑)6、其他文件:
(1.babelrc:瀏覽器解析的兼容配置,該文件主要是對預設(presets)和插件(plugins)進行配置,因此不同的轉譯器作用不同的配置項,大致可分為:語法轉義器、補丁轉義器、sx和flow插件
(2.editorconfig:用于配置代碼格式(配合代碼檢查工具使用,如:ESLint,團隊開發時可統一代碼風格),這里配置的代碼規范規則優先級高于編輯器默認的代碼格式化規則 。
(3.gitignore:配置git提交時需要忽略的文件
(4)postcssrc.js: autoprefixer(自動補全css樣式的瀏覽器前綴);postcss-import(@import引入語法)、CSS Modules(規定樣式作用域)
(5)index.html:項目入口頁面,編譯之后所有代碼將插入到這來
(6package.json:npm的配置文件(npm install根據package.json下載對應版本的安裝包)
(7package.lock.json:npm install(安裝)時鎖定各包的版本號
(8README.md:項目使用說明

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/278681.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/278681.shtml
英文地址,請注明出處:http://en.pswp.cn/news/278681.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

js獲取當前日期

var myDate new Date(); myDate.getYear(); //獲取當前年份(2位) myDate.getFullYear(); //獲取完整的年份(4位,1970-????) myDate.getMonth(); //獲取當前月份(0-11,0代表1月) myDate.getDate(); //獲取當前日(1-31) myDate.getDay(); //獲取當前星期X(0-6,0代表星期天) …

如何在不支付Adobe Photoshop費用的情況下處理Camera Raw

You might think that you need expensive software to take advantage of Camera RAW—something like Photoshop or the more modestly priced Lightroom. Fortunately there is freeware that can help you achieve professional results without professional costs. 您可能…

eclipse 代碼提示后面的百分比是什么意思?

簡而言之&#xff0c;就是提示你其他人&#xff08;開發人員&#xff09;在此情形下使用該方法百分比&#xff0c;最常用方法百分比 見http://www.eclipse.org/recommenders/manual/#d0e32 Call Completion The Call Completion engine, for example, provides you with recomm…

python實現關聯規則

代碼中Ci表示候選頻繁i項集&#xff0c;Li表示符合條件的頻繁i項集    # codingutf-8    def createC1(dataSet): # 構建所有1項候選項集的集合    C1 []    for transaction in dataSet:    for item in transaction:    if [item] not in C1:   …

Progressive Web App(PWA)

Progressive Web App一、 PWA 宣傳 &#xff1a; Reliable &#xff08; 可靠的 &#xff09;、Fast&#xff08; 快速的 &#xff09;、Engaging&#xff08; 可參與的 &#xff09;二、什么是Progressive三、為什么我們需要Progressive Web App一、 PWA 宣傳 &#xff1a; Re…

travis-cli 使用

1. 添加項目登錄 travis 選擇對應項目即可 2. 添加持續集成文件.travis.ymllanguage: node_js node_js:- "node" before_install: - npm install -g jspm - jspm install script: - jspm bundle lib/main --inject備注&#xff1a;這是一個jspm 項目 3. 構建travis 是…

在Windows Media Center中收聽超過100,000個廣播電臺

A cool feature in Windows 7 Media Center is the ability to listen to local FM radio. But what if you don’t have a tuner card that supports a connected radio antenna? The RadioTime plugin solves the problem by allowing access to thousands of online radio …

vue項目中按需引入viewUI

viewUI一、按需引入二、忽略eslint編譯器檢測和編譯檢測1.忽略編譯器檢測2.編譯器中忽略一、按需引入 npm install babel-plugin-import --save-dev // .babelrc1 { “plugins”: [[“import”, { “libraryName”: “view-design”, “libraryDirectory”: “src/components”…

IntelliJ IDEA——數據庫集成工具(Database)的使用

idea集成了一個數據庫管理工具&#xff0c;可以可視化管理很多種類的數據庫&#xff0c;意外的十分方便又好用。這里以oracle為例配置。 1、配置 在窗口的右邊有個Database按鈕&#xff0c;點擊。 如果沒有&#xff0c;請點擊上方的View(視圖)-Tool Windows(工具窗口)-Database…

為什么VC經常輸出燙燙燙燙燙燙燙燙

在Debug 模式下&#xff0c; VC 會把未初始化的棧內存全部填成0xcc&#xff0c;當字符串看就是 燙燙燙燙……會把未初始化的堆內存全部填成0xcd&#xff0c;當字符串看就是 屯屯屯屯……可以讓我們方便地看出那些內存沒初始化但是Release 模式下不會有這種附加動作&#xff0c;…

代碼評審會議_如何將電話會議(和訪問代碼)另存為聯系人

代碼評審會議Dialing a conference call doesn’t have to be a tedious process. Your iPhone or Android phone can automatically dial into the call and enter a confirmation code for you. You just have to create a special type of contact. 撥打電話會議不一定是一個…

Vuex使用總結

Vuex綜合使用一、倉庫1.主倉庫2.子倉庫二、使用1.全局&#xff08;index.js和未開啟命名空間的子倉庫&#xff09;2.子倉庫&#xff08;子倉庫定義了namespaced: true&#xff09;&#xff0c;倉庫名&#xff1a;home3.使用strict嚴格模式&#xff08;建議&#xff09;三、批量…

好未來提前批

好未來提前批(注&#xff1a;轉載于牛客網) 一面&#xff08;25minutes&#xff09; 1.創建對象的幾種方式2.Jsp九大隱式對象3.自己封裝的持久層框架用過么4.Spring ioc讓你實現怎么實現呢&#xff08;工廠反射&#xff0c;我半年前寫過&#xff0c;忘記了&#xff09;5.Aop的實…

Nginx服務學習(6)-日志模塊

日志模塊的說明 日志的默認路徑&#xff1a;error_log /var/log/nginx/error.log warn; warn是指日志的等級&#xff0c;一般有debug, info, notice, warn, error, crit。access_log /var/log/nginx/access.log main; main是指訪問日志記錄的格式信息&#xff0c;在…

vue mock模擬后臺接口數據

vue mock一、Json server二、Mock 服務1.安裝2.創建 Mock3.main.js引入4.組件中axure請求一、Json server 輕量級&#xff0c;將已有的json文件跑在服務器上供前端調用 npm install -g json-server 啟動JSON數據服務器&#xff1a; json-server --watch json文件名 或 json-se…

個人站立會議-----20181216

繼續閱讀測量程序設計這本書&#xff0c;并根據測量平差基礎中的知識編寫多個已知點水準網的間接平差&#xff0c;結果總是差些&#xff0c;詢問過老師之后&#xff0c;才知道在程序中要增加檢索閉合歡或閉合線段的條件&#xff0c;正在改進中 轉載于:https://www.cnblogs.com/…

使用iOS 4越獄iPhone或iPod Touch

In case you haven’t heard the news over the past couple of days, there is now an incredibly easy way to jailbreak your iPod Touch or iPhone running iOS 4. Here we will take a look at how easy the process is. 如果您在過去的幾天里沒有聽到這個消息&#xff0c…

[轉] 深入理解React 組件狀態(State)

React 的核心思想是組件化的思想&#xff0c;應用由組件搭建而成&#xff0c;而組件中最重要的概念是State&#xff08;狀態&#xff09;&#xff0c;State是一個組件的UI數據模型&#xff0c;是組件渲染時的數據依據。 一. 如何定義State 定義一個合適的State&#xff0c;是正…

vue-router query,parmas,meta傳參

1.query&#xff0c;顯示在導航欄&#xff1f;后&#xff0c;相當于get請求傳參 this.router.push({path:/login,query:{ redirect:/home}}) this.router.push({name:Login,query:{ redirect:/home}})2.parmas&#xff0c;不會顯示&#xff0c;相當于post請求傳參&#xff0c;…

Keras 獲取中間某一層輸出

1.使用函數模型API&#xff0c;新建一個model&#xff0c;將輸入和輸出定義為原來的model的輸入和想要的那一層的輸出&#xff0c;然后重新進行predict. 1 #codingutf-82 import seaborn as sbn3 import pylab as plt4 import theano5 from keras.models import Sequential6 fr…