前端vue实战项目结构、常用编辑器vs code 配置

  • 5.Complete JSDoc Tags

  • 6.Custom CSS and JS Loader

  • 7.Debugger for Chrome

  • 8.EditorConfig for VS Code

  • 9.ESLint ☆☆☆

  • 10.gitignore

  • 11.GitLens — Git supercharged

  • 12.npm

  • 13.PostCSS syntax !important

  • 14.Vetur ☆

  • 15.vscode-icons

  • 16.vue-i18n

  • 17.Markdown All in One

  • 配置文件

    • 1.用户代码片段配置
  • 2.settings.json配置实现自动格式化代码

  • 二、 vue项目目录结构(基于vue-cli3搭建)

    • 1.assets
  • 2.components

  • 3.mixins

  • 4.router

  • 5.views

  • 6.error-log.js错误日志

  • 7.tools

  • 8.webpack配置文件

一、vs code常用插件及配置文件(按字母排序)

=======================================================================================

1.Axios Snippets


超好用的 axios 代码补全片段,支持在.vue.js.html.ts文件中使用

在这里插入图片描述

这个插件方便代码vue js html ts及es6语法的补全

2.Beautify ☆☆


亮高美化代码

3.Better Comments


在这里插入图片描述

4.Chinese (Simplified) Language中文 ☆☆☆


在这里插入图片描述

安装后,在 locale.json 中添加 “locale”: “zh-cn”,即可载入中文(简体)语言包。要修改 locale.json,你可以同时按下 Ctrl+Shift+P 打开命令面板,之后输入 “config” 筛选可用命令列表,最后选择配置语言命令。请参阅文档并获取更多信息。

5.Complete JSDoc Tags


在这里插入图片描述

6.Custom CSS and JS Loader


在这里插入图片描述

7.Debugger for Chrome


在这里插入图片描述

支持谷歌在线调式,配置文件如下:

{

// 使用 IntelliSense 了解相关属性。

// 悬停以查看现有属性的描述。

// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387

“version”: “0.2.0”,

“configurations”: [

{

“type”: “chrome”,

“request”: “launch”,

“name”: “Launch Chrome against localhost”,

“url”: “http://localhost:8080”,

“webRoot”: “${workspaceFolder}/src”

}

]

}

8.EditorConfig for VS Code


在这里插入图片描述

在项目根目录下配置这样一个文件

在这里插入图片描述

如下:

root = true

[*]

charset = utf-8

indent_style = space

indent_size = 2

end_of_line = lf

insert_final_newline = true

trim_trailing_whitespace = true

9.ESLint ☆☆☆


在这里插入图片描述

安装好插件后修改set.json配置文件实现自动监听vue、html、js文件是否满足.eslintrc.js文件里rules的规则,可以自定项目的代码规范。

set.json配置如下:

{

“files.autoSave”: “off”,

//eslint 代码自动检查相关配置

“eslint.autoFixOnSave”: true,

“eslint.validate”: [

“javascriptreact”,

“javascript”,

{

“language”: “vue”,

“autoFix”: true

},

“html”

]

}

.eslintrc.js及相关rules常用的配置解释如下:

module.exports = {

root: true,

parserOptions: {

parser: ‘babel-eslint’,

sourceType: ‘module’

},

env: {

browser: true,

node: true,

es6: true,

mocha: true

},

extends: [

// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention

// consider switching to plugin:vue/strongly-recommended or plugin:vue/recommended for stricter rules.

‘plugin:vue/essential’,

// https://github.com/standard/standard/blob/master/docs/RULES-en.md

‘standard’

],

plugins: [

‘vue’

],

rules: { // 参考https://eslint.org/docs/rules

‘no-console’: process.env.NODE_ENV === ‘production’ ? ‘error’: ‘off’, //禁止使用console

‘no-debugger’: process.env.NODE_ENV === ‘production’ ? ‘error’ : ‘off’, // allow debugger during development

“no-alert”: process.env.NODE_ENV === ‘production’ ? ‘error’ : ‘off’,//禁止使用alert confirm prompt

“no-array-constructor”: 2,//禁止使用数组构造器

“no-bitwise”: 0,//禁止使用按位运算符

“no-caller”: 1,//禁止使用arguments.caller或arguments.callee

“no-catch-shadow”: 2,//禁止catch子句参数与外部作用域变量同名

“no-class-assign”: 2,//禁止给类赋值

“no-cond-assign”: 2,//禁止在条件表达式中使用赋值语句

“no-const-assign”: 2,//禁止修改const声明的变量

“no-constant-condition”: 2,//禁止在条件中使用常量表达式 if(true) if(1)

“no-continue”: 0,//禁止使用continue

“no-control-regex”: 2,//禁止在正则表达式中使用控制字符

“no-delete-var”: 2,//不能对var声明的变量使用delete操作符

“no-div-regex”: 1,//不能使用看起来像除法的正则表达式/=foo/

“no-dupe-keys”: 2,//在创建对象字面量时不允许键重复 {a:1,a:1}

“no-dupe-args”: 2,//函数参数不能重复

“no-duplicate-case”: 2,//switch中的case标签不能重复

“no-else-return”: 2,//如果if语句里面有return,后面不能跟else语句

“no-empty”: 2,//块语句中的内容不能为空

“no-empty-character-class”: 2,//正则表达式中的[]内容不能为空

“no-eq-null”: 0,//禁止对null使用==或!=运算符

“no-eval”: 1,//禁止使用eval

“no-ex-assign”: 2,//禁止给catch语句中的异常参数赋值

“no-extend-native”: 2,//禁止扩展native对象

“no-extra-bind”: 2,//禁止不必要的函数绑定

“no-extra-boolean-cast”: 2,//禁止不必要的bool转换

“no-extra-parens”: 2,//禁止非必要的括号

“no-extra-semi”: 2,//禁止多余的冒号

“no-fallthrough”: 1,//禁止switch穿透

“no-floating-decimal”: 2,//禁止省略浮点数中的0 .5 3.

“no-func-assign”: 2,//禁止重复的函数声明

“no-implicit-coercion”: 1,//禁止隐式转换

“no-implied-eval”: 2,//禁止使用隐式eval

“no-inline-comments”: 0,//禁止行内备注

“no-inner-declarations”: [2, “functions”],//禁止在块语句中使用声明(变量或函数)

“no-invalid-regexp”: 2,//禁止无效的正则表达式

“no-invalid-this”: 2,//禁止无效的this,只能用在构造器,类,对象字面量

“no-irregular-whitespace”: 2,//不能有不规则的空格

“no-iterator”: 2,//禁止使用__iterator__ 属性

“no-label-var”: 2,//label名不能与var声明的变量名相同

“no-labels”: 2,//禁止标签声明

“no-lone-blocks”: 2,//禁止不必要的嵌套块

“no-lonely-if”: 2,//禁止else语句内只有if语句

“no-loop-func”: 1,//禁止在循环中使用函数(如果没有引用外部变量不形成闭包就可以)

“no-mixed-requires”: [0, false],//声明时不能混用声明类型

“no-mixed-spaces-and-tabs”: [2, false],//禁止混用tab和空格

“linebreak-style”: [0, “windows”],//换行风格

“no-multi-spaces”: 1,//不能用多余的空格

“no-multi-str”: 2,//字符串不能用\换行

“no-multiple-empty-lines”: [1, {“max”: 2}],//空行最多不能超过2行

“no-native-reassign”: 2,//不能重写native对象

“no-negated-in-lhs”: 2,//in 操作符的左边不能有!

“no-nested-ternary”: 0,//禁止使用嵌套的三目运算

“no-new”: 1,//禁止在使用new构造一个实例后不赋值

“no-new-func”: 1,//禁止使用new Function

“no-new-object”: 2,//禁止使用new Object()

“no-new-require”: 2,//禁止使用new require

“no-new-wrappers”: 2,//禁止使用new创建包装实例,new String new Boolean new Number

“no-obj-calls”: 2,//不能调用内置的全局对象,比如Math() JSON()

“no-octal”: 2,//禁止使用八进制数字

“no-octal-escape”: 2,//禁止使用八进制转义序列

“no-param-reassign”: 2,//禁止给参数重新赋值

“no-path-concat”: 0,//node中不能使用__dirname或__filename做路径拼接

“no-plusplus”: 0,//禁止使用++,–

“no-process-env”: 0,//禁止使用process.env

“no-process-exit”: 0,//禁止使用process.exit()

“no-proto”: 2,//禁止使用__proto__属性

“no-redeclare”: 2,//禁止重复声明变量

“no-regex-spaces”: 2,//禁止在正则表达式字面量中使用多个空格 /foo bar/

“no-restricted-modules”: 0,//如果禁用了指定模块,使用就会报错

“no-return-assign”: 1,//return 语句中不能有赋值表达式

“no-script-url”: 0,//禁止使用javascript:void(0)

“no-self-compare”: 2,//不能比较自身

“no-sequences”: 0,//禁止使用逗号运算符

“no-shadow”: 2,//外部作用域中的变量不能与它所包含的作用域中的变量或参数同名

“no-shadow-restricted-names”: 2,//严格模式中规定的限制标识符不能作为声明时的变量名使用

“no-spaced-func”: 2,//函数调用时 函数名与()之间不能有空格

“no-sparse-arrays”: 2,//禁止稀疏数组, [1,2]

“no-sync”: 0,//nodejs 禁止同步方法

“no-ternary”: 0,//禁止使用三目运算符

“no-trailing-spaces”: 1,//一行结束后面不要有空格

“no-this-before-super”: 0,//在调用super()之前不能使用this或super

“no-throw-literal”: 2,//禁止抛出字面量错误 throw “error”;

“no-undef”: 2,//不能有未定义的变量

“no-undef-init”: 2,//变量初始化时不能直接给它赋值为undefined

“no-undefined”: 0,//不能使用undefined

“no-unexpected-multiline”: 2,//避免多行表达式

“no-underscore-dangle”: 1,//标识符不能以_开头或结尾

“no-unneeded-ternary”: 0,//禁止不必要的嵌套 var isYes = answer === 1 ? true : false;

“no-unreachable”: 2,//不能有无法执行的代码

“no-unused-expressions”: 0,//禁止无用的表达式

“no-unused-vars”: [2, {“vars”: “all”, “args”: “after-used”}],//不能有声明后未被使用的变量或参数

“no-use-before-define”: 2,//未定义前不能使用

“no-useless-call”: 2,//禁止不必要的call和apply

“no-void”: 2,//禁用void操作符

“no-var”: 0,//禁用var,用let和const代替

“no-warning-comments”: [1, { “terms”: [“todo”, “fixme”, “xxx”], “location”: “start” }],//不能有警告备注

“no-with”: 2,//禁用with

“array-bracket-spacing”: [2, “never”],//是否允许非空数组里面有多余的空格

“arrow-parens”: 0,//箭头函数用小括号括起来

“arrow-spacing”: [2,{‘before’:true,‘after’:true}],//=>的前/后括号

“accessor-pairs”: 0,//在对象中使用getter/setter

“block-scoped-var”: 0,//块语句中使用var

“brace-style”: [1, “1tbs”],//大括号风格

“callback-return”: 1,//避免多次调用回调什么的

“camelcase”: 0,//强制驼峰法命名

“comma-dangle”: [2, “never”],//对象字面量项尾不能有逗号

“comma-spacing”: [2,{‘before’: false, “after”:true}],//逗号前后的空格

“comma-style”: [2, “last”],//逗号风格,换行时在行首还是行尾

“complexity”: [0, 11],//循环复杂度

“computed-property-spacing”: 2,//是否允许计算后的键名什么的

“consistent-return”: 0,//return 后面是否允许省略

“consistent-this”: [2, “that”],//this别名

“constructor-super”: 0,//非派生类不能调用super,派生类必须调用super

“curly”: [2, “all”],//必须使用 if(){} 中的{}

“default-case”: 2,//switch语句最后必须有default

“dot-location”: 0,//对象访问符的位置,换行的时候在行首还是行尾

“dot-notation”: [0, { “allowKeywords”: true }],//避免不必要的方括号

“eol-last”: 0,//文件以单一的换行符结束

“eqeqeq”: 2,//必须使用全等

“func-names”: 0,//函数表达式必须有名字

“func-style”: [0, “declaration”],//函数风格,规定只能使用函数声明/函数表达式

“generator-star-spacing”: [2,{‘before’: true, “after”:false}],//生成器函数*的前后空格

“guard-for-in”: 0,//for in循环要用if语句过滤

“handle-callback-err”: 0,//nodejs 处理错误

“id-length”: 0,//变量名长度

“indent”: [2, 2],//缩进风格

“init-declarations”: 0,//声明时必须赋初值

“key-spacing”: [2, { “beforeColon”: false, “afterColon”: true }],//对象字面量中冒号的前后空格

“lines-around-comment”: 0,//行前/行后备注

“max-depth”: [0, 4],//嵌套块深度

“max-len”: [0, 80, 4],//字符串最大长度

“max-nested-callbacks”: [0, 2],//回调嵌套深度

“max-params”: [0, 3],//函数最多只能有3个参数

“max-statements”: [0, 10],//函数内最多有几个声明

“new-cap”: 2,//函数名首行大写必须使用new方式调用,首行小写必须用不带new方式调用

“new-parens”: 2,//new时必须加小括号

“newline-after-var”: 0,//变量声明后是否需要空一行

“object-curly-spacing”: [0, “never”],//大括号内是否允许不必要的空格

“object-shorthand”: 0,//强制对象字面量缩写语法

“one-var”: 1,//连续声明

“operator-assignment”: [0, “always”],//赋值运算符 += -=什么的

“operator-linebreak”: [2, “after”],//换行时运算符在行尾还是行首

“padded-blocks”: 0,//块语句内行首行尾是否要空行

“prefer-const”: 0,//首选const

“prefer-spread”: 0,//首选展开运算

“prefer-reflect”: 0,//首选Reflect的方法

“quotes”: 0, //禁止引号 ‘’ “” ``

“jsx-quotes”: 0, //禁止jsx引号

“quote-props”: 0,//对象字面量中的属性名是否强制双引号

“radix”: 2,//parseInt必须指定第二个参数

“id-match”: 0,//命名检测

“require-yield”: 0,//生成器函数必须有yield

“semi”: 0,//语句强制分号结尾

“semi-spacing”: 0,//分号前后空格

“sort-vars”: 0,//变量声明时排序

“space-after-keywords”: [0, “always”],//关键字后面是否要空一格

“space-before-blocks”: [2, “always”],//不以新行开始的块{前面要不要有空格

“space-before-function-paren”: [2, “never”],//函数定义时括号前面要不要有空格

“space-in-parens”: [2, “never”],//小括号里面要不要有空格

“space-infix-ops”: 2,//中缀操作符周围要不要有空格

“space-unary-ops”: [2, { “words”: true, “nonwords”: false }],//一元运算符的前/后要不要加空格

“spaced-comment”: 2,//注释风格要不要有空格什么的

“strict”: 2,//使用严格模式

“use-isnan”: 2,//禁止比较时使用NaN,只能用isNaN()

“valid-jsdoc”: 0,//jsdoc规则

“valid-typeof”: 2,//必须使用合法的typeof的值

“vars-on-top”: 2,//var必须放在作用域顶部

“wrap-iife”: [2, “inside”],//立即执行函数表达式的小括号风格

“wrap-regex”: 0,//正则表达式字面量用小括号包起来

“yoda”: [2, “never”]//禁止尤达条件

}

}

10.gitignore


在这里插入图片描述

11.GitLens — Git supercharged


在这里插入图片描述

12.npm


在这里插入图片描述

13.PostCSS syntax !important


在这里插入图片描述

在项目根目录配置如下文件

在这里插入图片描述

代码如下:

module.exports = {

plugins: {

“postcss-partial-import”: {},

precss: {},

“postcss-advanced-variables”: {},

autoprefixer: {}

}

}

14.Vetur ☆


在这里插入图片描述

.vue文件中标签js的亮高

15.vscode-icons


在这里插入图片描述

配置文件类型的图标

16.vue-i18n


在这里插入图片描述

这个插件能够帮到你方便查看和编写 vue-i18n

17.Markdown All in One


在这里插入图片描述

附加vs code插件安装市场 链接

配置文件


1.用户代码片段配置

方便模块化开发节约编辑代码时间,例如vue指令配置模板

{

// Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and

// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope

// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is

// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:

// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.

// Placeholders with the same ids are connected.

// Example:

“Print to console”: {

// “scope”: “javascript,typescript”,

“prefix”: “vue”,

“body”: [

“”,

" <div class=“$0”>$0",

“”,

“”,

“import ViewMixin from “@/mixins/view-mixins.js””,

“export default {”,

" name: “$0”,",

" mixins: [ViewMixin()],",

" components: {",

" },",

" data() {",

" return {",

" }",

" },",

" watch: {",

" },",

" computed: {",

" },",

" mounted() {",

" },",

" methods: {",

" },",

" destroyed() {",

" }",

“}”,

“”,

“<style lang=“postcss” scoped>”,

“”

],

“description”: “vue template order”

}

}

2.settings.json配置实现自动格式化代码

{

“editor.suggestSelection”: “first”,

“vsintellicode.modify.editor.suggestSelection”: “automaticallyOverrodeDefaultValue”,

“gitlens.advanced.messages”: {

“suppressGitVersionWarning”: true

},

“files.autoSave”: “off”,

“files.associations”: {

“*.css”: “postcss”

},

“eslint.autoFixOnSave”: true,

“eslint.validate”: [

“javascript”,

“javascriptreact”,

“html”,

{

“language”: “vue”,

“autoFix”: true

}

],

“editor.tabSize”: 2,

“terminal.integrated.rendererType”: “dom”,

“emmet.includeLanguages”: {

“postcss”: “css”

},

“[javascript]”: {

“editor.defaultFormatter”: “HookyQR.beautify”

},

“editor.codeActionsOnSave”: {

“source.fixAll.eslint”: true

},

“terminal.integrated.shell.windows”: “C:\Program Files\Git\bin\bash.exe”,

“eslint.codeAction.disableRuleComment”: {

}

// “workbench.iconTheme”: “vscode-icons”

// “workbench.colorTheme”: “SynthWave '84”

// “workbench.iconTheme”: “material-icon-theme”,

// “workbench.colorTheme”: “Material Theme”

}

二、 vue项目目录结构(基于vue-cli3搭建)

========================================================================================

项目结构如下:

在这里插入图片描述

1.assets


assets静态文件,/style公用的样式文件夹,像reset.css、normalize.css、element-ui.css、common.css、variable.css、default.css、index.css。/imge存放公用图片icon。/js公用的js插件

2.components


存放公用组件

3.mixins


存放混合于vue实例的全局方法,或在钩子执行统一的方法,一般设计开发人员用不上

4.router


结构如下:

在这里插入图片描述

routes.js存放路由的路由元信息结构

import DragColumn from ‘@/views/drag-column’

/**

  • hidden:false 是否在菜单中显示

  • meta: {

  • requireAuth, 是否需要登录授权

  • title  标题
    
  • }

  • **/

const routes = [

{

path: ‘/drag-column’,

component: DragColumn,

name: “DragColumn”,

meta: {

requireAuth: false,

title: ‘drag-column’

}

}

]

export default routes

guards存放路由钩子、路由守卫

export default permissionGuards = (to,from,next)=>{

if(to.matched.some()){

return MutationRecord.mete.requireAuth

}

return false

5.views


存放单页面应用中具体的每个组件页面,和router.js相对应

6.error-log.js错误日志


import Vue from ‘vue’;

if (process.env.NODE_ENV === ‘production’) {

Vue.config.errorHandler = (err, vm, info, a) => {

Vue.nextTick(() => {

vm

a

console.log(err, info);

});

};

}

7.tools


工具类文件夹,提供了连个快捷建立组件的方法,可在控制台输入:npm run new:comp 或 npm run new:view

代码如下:

const chalk = require(‘chalk’)

const path = require(‘path’)

const fs = require(‘fs’)

const resolveDir = (…file) => path.resolve(__dirname, …file)

// eslint-disable-next-line no-console

const log = message => console.log(chalk.green(${message}))

// eslint-disable-next-line no-console

const successLog = message => console.log(chalk.blue(${message}))

// eslint-disable-next-line no-console

const errorLog = error => console.log(chalk.red(${error}))

const {componentTemplate} = require(‘./template.js’)

const generateFile = (dir, data) => {

if (fs.existsSync(dir)) {

errorLog(${dir}文件已存在)

return

}

return new Promise((resolve, reject) => {

fs.writeFile(dir, data, ‘utf8’, err => {

if (err) {

errorLog(err.message)

reject(err)

} else {

resolve(true)

}

})

})

}

function mkdirs(directory, callback) {

let exists = fs.existsSync(directory)

if (exists) {

callback()

} else {

mkdirs(path.dirname(directory), () => {

fs.mkdirSync(directory)

callback()

})

最后

7.tools


工具类文件夹,提供了连个快捷建立组件的方法,可在控制台输入:npm run new:comp 或 npm run new:view

代码如下:

const chalk = require(‘chalk’)

const path = require(‘path’)

const fs = require(‘fs’)

const resolveDir = (…file) => path.resolve(__dirname, …file)

// eslint-disable-next-line no-console

const log = message => console.log(chalk.green(${message}))

// eslint-disable-next-line no-console

const successLog = message => console.log(chalk.blue(${message}))

// eslint-disable-next-line no-console

const errorLog = error => console.log(chalk.red(${error}))

const {componentTemplate} = require(‘./template.js’)

const generateFile = (dir, data) => {

if (fs.existsSync(dir)) {

errorLog(${dir}文件已存在)

return

}

return new Promise((resolve, reject) => {

fs.writeFile(dir, data, ‘utf8’, err => {

if (err) {

errorLog(err.message)

reject(err)

} else {

resolve(true)

}

})

})

}

function mkdirs(directory, callback) {

let exists = fs.existsSync(directory)

if (exists) {

callback()

} else {

mkdirs(path.dirname(directory), () => {

fs.mkdirSync(directory)

callback()

})

最后

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/31126.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

2024年最值得推荐的10款免费数据可视化工具!

数据可视化之所以受欢迎&#xff0c;不仅因为它简化了我们查看繁杂数据的方式&#xff0c;还在于数据可视化可以加快我们获取数据信息的速度。但是对于初学者来说&#xff0c;使用数据可视化工具并不能够快速上手。因此本篇文章特意为大家列出了10款免费的数据可视化工具&#…

html做一个画柱形图的软件

你可以使用 HTML、CSS 和 JavaScript 创建一个简单的柱形图绘制软件。为了方便起见&#xff0c;我们可以使用一个流行的 JavaScript 图表库&#xff0c;比如 Chart.js&#xff0c;它能够简化创建和操作图表的过程。 以下是一个完整的示例&#xff0c;展示如何使用 HTML 和 Cha…

码蹄集 BD202401 补给

错误解法&#xff1a;简单将取半前后的综合排序后取最小值&#xff0c;这样没有考虑这样一种情况&#xff1a;取半的时机不对&#xff0c;也许取半某个大一点的P之后反而能进一步取一个补给点了呢&#xff1f;&#xff1f;对不对。这样简单排序只不过是“最省钱”的一种&#x…

Cocos引擎加密方案解析

据2023年数据显示&#xff0c;Cocos引擎全球游戏市场的占有率约为20%&#xff0c;国内手游占有率约为40%&#xff0c;在国内手游市场中&#xff0c;不少热门游戏均为Cocos引擎研发&#xff0c;如《捕鱼达人》、《梦幻西游》、《剑与远征》等。 而在近年来国内火热的小游戏赛道…

java实现分类下拉树,点击时对应搜索---后端逻辑

一直想做分类下拉&#xff0c;然后选择后搜索的页面&#xff0c;正好做项目有了明确的需求&#xff0c;查找后发现el-tree的构件可满足需求&#xff0c;数据要求为&#xff1a;{ id:1, label:name, childer:[……] }形式的&#xff0c;于是乎&#xff0c;开搞&#xff01; 一…

算法训练营day15--110.平衡二叉树+ 257. 二叉树的所有路径+ 404.左叶子之和+222.完全二叉树的节点个数

一、110.平衡二叉树 题目链接&#xff1a;https://leetcode.cn/problems/balanced-binary-tree/ 文章讲解&#xff1a;https://programmercarl.com/0110.%E5%B9%B3%E8%A1%A1%E4%BA%8C%E5%8F%89%E6%A0%91.html 视频讲解&#xff1a;https://www.bilibili.com/video/BV1Ug411S7m…

体育时间:“中国第一”的出海代表们,一致瞄准了这一赛道?

2024年无疑又是一个体育赛事超级大年。 从1月的亚洲杯&#xff0c;2月的世乒团体锦标赛、第14届冬运会、到6月欧洲杯与美洲杯隔空对决&#xff0c;巴黎奥运会也将在7月盛大开赛&#xff0c;随后则还有8月的巴黎残奥会&#xff0c;对于期待万分的体育粉丝们&#xff0c;这将是极…

计算机编码以及URL转码

目录 一、计算机编码 1.ASCII编码 2. GB2312编码 3.GBK编码 4.UTF-8编码 二、URL转码 1.encodeURI和decodeURI 2.encodeURIComponent 和 decodeURIComponent 三、Base64 一、计算机编码 在计算机中&#xff0c;所有的数据在存储和运算时都要使用二进制数表示&#xf…

Spring Boot程序打包docker镜像

1.将springboot程序使用maven package打包出jar。 2.创建dockerfile。 FROM openjdk:8 VOLUME /tmp EXPOSE 8601 #ADD 后面的参数是项目名字 / 后面的参数是自定义的别名 ADD webflux-hello-0.0.1-SNAPSHOT.jar /webflux-hello.jar #这里的最后一个变量需要和前面起的别名相同…

Python 爬取淘宝指定搜索商品评论 标题 销量 计算sign

只需要替换原来的Cookie和token即可使用&#xff0c;自动计算对应链接地址的sign直接使用即可。需要注意是一个账号爬取过多会有验证码 import json import hashlib import random import timeimport pandas as pd import requestsresults []def fetch_review_list(datas, md…

vuejs3+elementPlus后台管理系统,左侧菜单栏制作,跳转、默认激活菜单

默认激活菜单,效果&#xff1a; 默认激活菜单&#xff0c;效果1&#xff1a; 默认激活菜单&#xff0c;效果2&#xff1a; 跳转链接效果&#xff1a; 制作&#xff1a; <script setup> import {useUserStore} from "/stores/userStore.js"; import {ref} fr…

适配器模式(大话设计模式)C/C++版本

适配器模式 C #include <iostream> using namespace std; // 球员 class Player { protected:string name;public:Player(string name) : name(name) {}virtual void Attack() 0;virtual void Defense() 0;virtual ~Player() {} }; // 前锋 class Forwards : public P…

20240613解决飞凌的OK3588-C的核心板的USB3.0接口不读U盘的问题

20240613解决飞凌的OK3588-C的核心板的USB3.0接口不读U盘的问题 2024/6/13 15:21 缘起&#xff0c;由于USB3.0的CC芯片在飞凌的OK3588-C的开发板的底板上&#xff0c;一切正常。 如果你单独使用核心板&#xff0c;很容易出现这个问题【省成本没有使用CC芯片】&#xff1a;不读U…

300PLC连接Modbus转Profibus网关与阀岛modbusRTU通讯

一、概况 300PLC作为常见的控制器设备&#xff0c;在与阀岛Modbus RTU通讯时&#xff0c;通常需要借助Modbus转Profibus网关&#xff08;XD-MDPB100&#xff09;来实现连接和数据交换。PLC通过Modbus转Profibus网关&#xff08;XD-MDPB100&#xff09;与阀岛Modbus RTU通讯是比…

labelme使用笔记:目标检测数据集标注和语义分割数据集批量生成

AI应用开发相关目录 本专栏包括AI应用开发相关内容分享&#xff0c;包括不限于AI算法部署实施细节、AI应用后端分析服务相关概念及开发技巧、AI应用后端应用服务相关概念及开发技巧、AI应用前端实现路径及开发技巧 适用于具备一定算法及Python使用基础的人群 AI应用开发流程概…

[AIGC] 使用Google的Guava库中的Lists工具类:常见用法详解

在Java程序设计中&#xff0c;集合是我们最常用的数据结构之一。为了方便我们操作集合&#xff0c;Google的Guava库提供了一个名为Lists的工具类&#xff0c;它封装了许多用于操作List对象的实用方法。在本文中&#xff0c;我们将详细介绍其常见的用法&#xff0c;以帮助您更好…

PyQt5 生成py文件不能运行;pushButton点击事件;QTextEdit 获取输入框内容

目录 cant open file c.pyuic: c.pyuic $FileName$ -o $FileNameWithoutExtension$.p PyQt5 生成py文件不能运行 pushButton点击事件 QTextEdit 获取输入框内容 整体运行代码: Creating a Qt Widget Based Application | Qt Creator Manual cant open file c.pyuic: c.…

NAT Easyip实验

我们这篇博客将重点讲述easy ip的配置&#xff1a; 以下面的一个简单的实验拓扑图为例&#xff1a; 本实验使用的网络地址&#xff1a; 1. 我们先来完成基础配置&#xff1a; 1.1AR1的基础配置&#xff1a; 1.2AR2上的基础配置 1.3完成AR1和AR2的基础配置后&#xff0c;我们…

rust数据类型

目录 一&#xff0c;基本类型 1&#xff0c;基本类型 &#xff08;1&#xff09;整数类型 &#xff08;2&#xff09;浮点数 &#xff08;3&#xff09;bool类型 &#xff08;4&#xff09;char类型 2&#xff0c;基本类型的代数结构 二&#xff0c;复合类型 1&#x…

这些帮助你成长的IOS应用,建议收藏

TrackIt TrackIt是一款功能丰富的任务清单、日程管理和习惯打卡应用&#xff0c;旨在帮助用户提高效率和专注力。通过这些功能&#xff0c;用户可以更好地规划时间和任务&#xff0c;从而实现个人目标和养成良好习惯。 在目标设定方面&#xff0c;SMART原则是一个常用的方法&a…