SpringBoot + Vue前后端分离项目实战 || 一:Vue前端设计

文章目录

    • 环境配置
    • 开发工具
    • 下载Vue前端模板
    • 前端项目启动
    • 前端说明及修改
      • 修改导航栏
      • 自定义菜单与子菜单
      • 增加导航标签功能
    • 前端数据格式

B站视频讲解:2023全网最简单但实用的SpringBoot+Vue前后端分离项目实战

不想看视频可浏览此文章笔记,比较详细

环境配置

Nodejs: 8.17.0
Vue: 3.11.0
Maven: 3.6.0
Java版本: 1.8.0_371
MySQL: 5.5_56
Redis: 5.0.14

一般推荐使用低版本,因为高版本兼容低版本,反之不行

开发工具

IDEA 2021(后端)
VScode(前端)

下载Vue前端模板

https://panjiachen.gitee.io/vue-element-admin-site/zh/guide/
在这里插入图片描述
此处建议下载1和2,项目主要基于2开发,但是会拓展一个前端功能需要用到1里面的代码

选择2后,可下载其他版本,此处我下载的是v3.0.0
在这里插入图片描述
在这里插入图片描述

下载完成后将第2个基础模版解压到任意能找到的目录(不推荐目录中包含中文字符)
在这里插入图片描述

打开VScode,选择 文件 -> 打开文件夹
在这里插入图片描述
在这里插入图片描述

如下图 打开成功
在这里插入图片描述

前端项目启动

打开集成终端,一定要定位到package.json级别的目录
在这里插入图片描述

然后终端输入命令 npm install
在这里插入图片描述

会自动下载项目的依赖
在这里插入图片描述

依赖下载完毕后 启动项目,运行命令npm run dev
在这里插入图片描述

出现以下信息表示成功
在这里插入图片描述
打开链接即可
在这里插入图片描述

前端说明及修改

前端的总体配置在文件vue.config.js
在这里插入图片描述

第16行 是端口号,可修改,此处我修改为8888
在这里插入图片描述

第34行 为是否启动项目就默认打开浏览器,因为vue支持热修改,并不用每次改完前端就需要重新启动,改完保存后前端页面就自动修改,所以此处设为false
在这里插入图片描述

所有的页面保存在src/views文件夹中,此处的view文件夹被我修改过,稍后说明修改流程
在这里插入图片描述

先修改登录页面src/views/login/index.vue
在这里插入图片描述

定位到第6行,修改title
在这里插入图片描述

定位到 187行,修改背景图,此时你需要找到一张背景图片,放在src/assets文件夹中

background-image: url(../../assets/bg.png); //背景图
background-size: 100%;

在这里插入图片描述

保存后页面会同步修改
在这里插入图片描述

为什么要在此处才能修改背景图?
在这里插入图片描述

我们在浏览器中按F12打开开发者模式,选择1,然后鼠标移动到整个页面都被选择,此时左下角出现了一个类名.login.container,记住该名称
在这里插入图片描述

打开VScode搜索.login-container ,注意页面显示的.login.container中第二个.替换为-变为.login-container,此处就是我们需要修改的样式的地方
在这里插入图片描述
其他的修改:

  1. 将英文变中文,其实就是找到对应的英文修改为中文,可在页面记住英文单词,然后进代码查找对应的英文在哪儿,然后打上中文即可
    在这里插入图片描述
  2. 修改登录表单为半透明,同样查找元素然后搜索login-form
    在这里插入图片描述
    在这里插入图片描述
    .login-form {
        position: relative;
        width: 520px;
        max-width: 100%;
        padding: 30px 35px 0;
        margin: 0 auto;
        overflow: hidden;
        background-color: #2d3a4b;  // 背景颜色
        border-radius: 5px;             // 表单圆角
        opacity: 0.85;                  // 透明度,值越小越越透明,取值为[0,1]
    }
    
  3. 附上我的src\views\login\inde.vue文件的全部代码
    <template>
      <div class="login-container">
        <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
    
          <div class="title-container">
            <h3 class="title">神盾局管理系统</h3>
          </div>
    
          <el-form-item prop="username">
            <span class="svg-container">
              <svg-icon icon-class="user" />
            </span>
            <el-input
              ref="username"
              v-model="loginForm.username"
              placeholder="用户名"  
              name="username"
              type="text"
              tabindex="1"
              auto-complete="on"
            />
          </el-form-item>
    
          <el-form-item prop="password">
            <span class="svg-container">
              <svg-icon icon-class="password" />
            </span>
            <el-input
              :key="passwordType"
              ref="password"
              v-model="loginForm.password"
              :type="passwordType"
              placeholder="密码"
              name="password"
              tabindex="2"
              auto-complete="on"
              @keyup.enter.native="handleLogin"
            />
            <span class="show-pwd" @click="showPwd">
              <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
            </span>
          </el-form-item>
    
          <el-button :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
    
          <!-- <div class="tips">
            <span style="margin-right:20px;">username: admin</span>
            <span> password: any</span>
          </div> -->
    
        </el-form>
      </div>
    </template>
    
    <script>
    
    import { validUsername } from '@/utils/validate'
    
    export default {
      name: 'Login',
      data() {
        const validateUsername = (rule, value, callback) => {
          if (!validUsername(value)) {
            callback(new Error('请输入正确的用户名'))
          } else {
            callback()
          }
        }
        const validatePassword = (rule, value, callback) => {
          if (value.length < 6) {
            callback(new Error('密码不能少于6位'))
          } else {
            callback()
          }
        }
        return {
          loginForm: {
            username: 'admin',
            password: '123456'
          },
          loginRules: {
            username: [{ required: true, trigger: 'blur', validator: validateUsername }],
            password: [{ required: true, trigger: 'blur', validator: validatePassword }]
          },
          loading: false,
          passwordType: 'password',
          redirect: undefined
        }
      },
      watch: {
        $route: {
          handler: function(route) {
            this.redirect = route.query && route.query.redirect
          },
          immediate: true
        }
      },
      methods: {
        showPwd() {
          if (this.passwordType === 'password') {
            this.passwordType = ''
          } else {
            this.passwordType = 'password'
          }
          this.$nextTick(() => {
            this.$refs.password.focus()
          })
        },
        handleLogin() {
          this.$refs.loginForm.validate(valid => {
            if (valid) {
              this.loading = true
              this.$store.dispatch('user/login', this.loginForm).then(() => {
                this.$router.push({ path: this.redirect || '/' })
                this.loading = false
              }).catch(() => {
                this.loading = false
              })
            } else {
              console.log('error submit!!')
              return false
            }
          })
        }
      }
    }
    </script>
    
    <style lang="scss">
    /* 修复input 背景不协调 和光标变色 */
    /* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
    
    $bg:#283443;
    $light_gray:#fff;
    $cursor: #fff;
    
    @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
      .login-container .el-input input {
        color: $cursor;
      }
    }
    
    /* reset element-ui css */
    .login-container {
      .el-input {
        display: inline-block;
        height: 47px;
        width: 85%;
    
        input {
          background: transparent;
          border: 0px;
          -webkit-appearance: none;
          border-radius: 0px;
          padding: 12px 5px 12px 15px;
          color: $light_gray;
          height: 47px;
          caret-color: $cursor;
    
          &:-webkit-autofill {
            box-shadow: 0 0 0px 1000px $bg inset !important;
            -webkit-text-fill-color: $cursor !important;
          }
        }
      }
    
      .el-form-item {
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.1);
        border-radius: 5px;
        color: #454545;
      }
    }
    </style>
    
    <style lang="scss" scoped>
    $bg:#2d3a4b;
    $dark_gray:#889aa4;
    $light_gray:#eee;
    
    .login-container {
      min-height: 100%;
      width: 100%;
      background-color: $bg;
      overflow: hidden;
    
      background-image: url(../../assets/bg.png); //背景图
      background-size: 100%;
    
    
      display: flex;
      align-items: center;
    
    
      .login-form {
        position: relative;
        width: 520px;
        max-width: 100%;
        padding: 30px 35px 0;
        margin: 0 auto;
        overflow: hidden;
        background-color: #2d3a4b;  // 背景颜色
        border-radius: 5px;             // 表单圆角
        opacity: 0.85;                  // 透明度,值越小越越透明,取值为[0,1]
      }
    
      .tips {
        font-size: 14px;
        color: #fff;
        margin-bottom: 10px;
    
        span {
          &:first-of-type {
            margin-right: 16px;
          }
        }
      }
    
      .svg-container {
        padding: 6px 5px 6px 15px;
        color: $dark_gray;
        vertical-align: middle;
        width: 30px;
        display: inline-block;
      }
    
      .title-container {
        position: relative;
    
        .title {
          font-size: 26px;
          color: $light_gray;
          margin: 0px auto 40px auto;
          text-align: center;
          font-weight: bold;
        }
      }
    
      .show-pwd {
        position: absolute;
        right: 10px;
        top: 7px;
        font-size: 16px;
        color: $dark_gray;
        cursor: pointer;
        user-select: none;
      }
    }
    </style>
    
    复制代码后注意背景图的链接地址下要有文件存在

修改 页面标签 找到src\settings.js文件,然后修改第3行title

在这里插入图片描述

修改完毕后浏览器标签会改变
在这里插入图片描述

修改导航栏

点击此处会有导航窗口
在这里插入图片描述

可自定义修改,找到scr\layout\components\Navbar.vue文件,修改红框处的代码
在这里插入图片描述
在这里插入图片描述

<el-dropdown-menu slot="dropdown" class="user-dropdown">
  <router-link to="/">
     <el-dropdown-item>
       个人信息
     </el-dropdown-item>
   </router-link>

   <a target="_blank" href="https://www.chinaums.com/">
     <el-dropdown-item>公司主页</el-dropdown-item>
   </a>
   <a target="_blank" href="https://www.hhu.edu.cn/">
     <el-dropdown-item>学校主页</el-dropdown-item>
   </a>
   <el-dropdown-item divided @click.native="logout">
     <span style="display:block;">退出登录</span>
   </el-dropdown-item>
 </el-dropdown-menu>

自定义菜单与子菜单

在这里插入图片描述

首先,在src\views\下新建文件夹systest,然后再分别在这两个文件夹中新建role.vueuser.vuetest1.vuetest2.vuetest3.vue文件,如下图所示
在这里插入图片描述

进入role.vue写代码
VScode中输入vue会自动代码提示(需在VScode中安装vue插件),回车即可
在这里插入图片描述

会自动生成模板
在这里插入图片描述

此时写上一些代码
在这里插入图片描述

其他新建的vue文件如法炮制

然后我们在src\router\index.js中路由链接这些新建的vue文件
在这里插入图片描述
在这里插入图片描述

新增代码及注释

{
    path: '/sys',       // 浏览器访问路径
    component: Layout,
    redirect: '/sys',   // 本地views下的sys文件夹
    name: 'sysManage',  // 名字,唯一标识
    meta: { title: '系统管理', icon: '1' },   // 标题和图标
    children: [       // 子菜单   
      {
        path: 'user',   // 子菜单的浏览器访问路径,与父菜单结合 /sys/user 最终形成http://localhost:8888/#/sys/user
        name: 'user',   // 名字,唯一标识
        component: () => import('@/views/sys/user'),   // 新建views下的user.vue文件,该文件一定要存在
        meta: { title: '用户管理', icon: '个人中心'}    // 标题和图标
      },
      {
        path: 'role',   // 子菜单的浏览器访问路径,与父菜单结合 /sys/role
        name: 'role',
        component: () => import('@/views/sys/role'),  // 新建view下的user.vue界面,必须存在
        meta: { title: '角色管理', icon: '新增组织' }
      }
    ]
 },

注意该代码中的icon:'1',这是自定义的图标,可在阿里巴巴矢量图标库中下载自己喜欢的图标

在这里插入图片描述

找到喜欢的图标后点击SVG下载
在这里插入图片描述

下好的图标重命名后保存在src\icons\svg文件夹中
在这里插入图片描述

然后就可以在代码中用上该图标了,不用写路径后缀名
在这里插入图片描述

图标效果如下
在这里插入图片描述

我的src\router\index.js全部代码

import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

/**
 * Note: sub-menu only appear when route children.length >= 1
 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
 *
 * hidden: true                   if set true, item will not show in the sidebar(default is false)
 * alwaysShow: true               if set true, will always show the root menu
 *                                if not set alwaysShow, when item has more than one children route,
 *                                it will becomes nested mode, otherwise not show the root menu
 * redirect: noRedirect           if set noRedirect will no redirect in the breadcrumb
 * name:'router-name'             the name is used by <keep-alive> (must set!!!)
 * meta : {
    roles: ['admin','editor']    control the page roles (you can set multiple roles)
    title: 'title'               the name show in sidebar and breadcrumb (recommend set)
    icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
    breadcrumb: false            if set false, the item will hidden in breadcrumb(default is true)
    activeMenu: '/example/list'  if set path, the sidebar will highlight the path you set
  }
 */

/**
 * constantRoutes
 * a base page that does not have permission requirements
 * all roles can be accessed
 */
export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: { title: '首页', icon: 'dashboard' , affix:true}
    }]
  },

  {
    path: '/sys',       // 浏览器访问路径
    component: Layout,
    redirect: '/sys',   // 本地views下的sys文件夹
    name: 'sysManage',  // 名字,唯一标识
    meta: { title: '系统管理', icon: '1' },   // 标题和图标
    children: [       // 子菜单,此子菜单   
      {
        path: 'user',   // 子菜单的浏览器访问路径,与父菜单结合 /sys/user 最终形成http://localhost:8888/#/sys/user
        name: 'user',   // 名字,唯一标识
        component: () => import('@/views/sys/user'),   // 新建views下的user.vue文件,该文件一定要存在
        meta: { title: '用户管理', icon: '个人中心'}    // 标题和图标
      },
      {
        path: 'role',   // 子菜单的浏览器访问路径,与父菜单结合 /sys/role
        name: 'role',
        component: () => import('@/views/sys/role'),  // 新建view下的user.vue界面,必须存在
        meta: { title: '角色管理', icon: '新增组织' }
      }
    ]
  },

  {
    path: '/test',
    component: Layout,
    redirect: '/test',
    name: 'test',
    meta: { title: '功能模块', icon: 'tree' },
    children: [   //子菜单
      {
        path: 'test1',
        name: 'test1',
        component: () => import('@/views/test/test1'),   // 新建view下的user.vue界面
        meta: { title: '功能1', icon: '维护管理' }
      },
      {
        path: 'test2',
        name: 'test2',
        component: () => import('@/views/test/test2'),  // 新建view下的user.vue界面,必须存在
        meta: { title: '功能2', icon: '维护管理' }
      },
      {
        path: 'test3',
        name: 'test3',
        component: () => import('@/views/test/test3'),  // 新建view下的user.vue界面,必须存在
        meta: { title: '功能3', icon: '维护管理' }
      }
    ]
  },



  // 404 page must be placed at the end !!!
  { path: '*', redirect: '/404', hidden: true }
]

const createRouter = () => new Router({
  // mode: 'history', // require service support
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})

const router = createRouter()

// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
  const newRouter = createRouter()
  router.matcher = newRouter.matcher // reset router
}

export default router

注意复制代码时,确认好自己的icon图标文件

增加导航标签功能

如下图所示需要新增一个功能
在这里插入图片描述

此功能的代码在之前介绍的第一个项目中,现在需要将代码copy过来
在这里插入图片描述

下载好最新的一个压缩包后,解压缩,找到以下三个文件,注意这些文件复制到正在开发的项目中对应的路径中去,两个项目的路径设置是一样的
src/layout/components/TagsView
src/store/modules/tagsView.js
src/store/modules/permission.js

在这里插入图片描述
在这里插入图片描述

然后进入VScode中添加代码:

  1. 进入src/layout/components/AppMain.vue文件修改红框代码
    在这里插入图片描述

    <keep-alive :include="cachedViews">
        <router-view :key="key" />
    </keep-alive>
    
    
    export default {
      name: 'AppMain',
      computed: {
        key() {
          return this.$route.path
        },
        cachedViews() {
            return this.$store.state.tagsView.cachedViews
        }
      }
    }
    
  2. 修改文件src/store/getters.js
    在这里插入图片描述

      visitedViews: state => state.tagsView.visitedViews,
      cachedViews: state => state.tagsView.cachedViews,   
      permission_routes: state => state.permission.routes
    
  3. 修改文件src/store/index.js
    在这里插入图片描述

    import Vue from 'vue'
    import Vuex from 'vuex'
    import getters from './getters'
    import app from './modules/app'
    import settings from './modules/settings'
    import user from './modules/user'
    import tagsView from './modules/tagsView'
    
    Vue.use(Vuex)
    
    const store = new Vuex.Store({
      modules: {
        app,
        settings,
        user,
        tagsView
      },
      getters
    })
    
    export default store
    
  4. 修改文件src\layout\index.vue
    在这里插入图片描述

  5. 修改文件src\layout\components\index.js
    在这里插入图片描述

    export { default as TagsView } from './TagsView'
    

大功告成!重新启动项目npm run dev

如果我们想要设置某个标签不可关闭,如下图中首页标签,此时需要在src\router\index.js文件中找到首页然后添加属性affix:true
在这里插入图片描述

在这里插入图片描述

另外,标签导航是可以右击的,此处我将英文修改为了中文
在这里插入图片描述

大家可以在VScode中全局搜索浏览器弹出来的英文,然后查找,再将其修改为对应中文即可,此处修改路径为src\layout\components\TagsView\index.vue中第20
在这里插入图片描述

此时前端页面修改就大差不差了

前端数据格式

前后端对接需要知道前端登录的json数据传递格式

打开浏览器界面,按F12选择网络
在这里插入图片描述

然后点击登录,此时浏览器会记录状态
在这里插入图片描述

单击login会出现数据响应格式,如红框所示,这个格式后端写代码会用到
在这里插入图片描述

{"code":20000,"data":{"token":"admin-token"}}

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Java版企业工程项目管理系统源码+java版本+项目模块功能清单+spring cloud +spring boot

工程项目各模块及其功能点清单 一、系统管理 1、数据字典&#xff1a;实现对数据字典标签的增删改查操作 2、编码管理&#xff1a;实现对系统编码的增删改查操作 3、用户管理&#xff1a;管理和查看用户角色 4、菜单管理&#xff1a;实现对系统菜单的增删改查操…

青大数据结构【2020】【三分析计算】

关键字&#xff1a; 无相连通图、Prim算法最小生成树、哈希函数、线性探测法、平均查找长度 1.对于一个带权连通无向图G&#xff0c;可以采用Prim算法构造出从某个顶点v出发的最小生成树&#xff0c;问该最小生成树是否一定包含从顶点v到其他所有顶点的最短路径。如果回答是&a…

kafka 报错 - Cannot assign requested address

背景 在华为云服务器上跑了 zookeeper 和 kafka 的 broker&#xff0c;想内外网分流&#xff0c;重点就是做不到从外网去消费&#xff0c;比如用自己的 windows 笔记本去消费。 配置 server.properties 的 listener 为 broker 所在机子的的内网 IP 后&#xff0c;终于能 star…

Vulnhub项目:Aragog

1、靶机地址&#xff1a; HarryPotter: Aragog (1.0.2) ~ VulnHub 死亡圣器三部曲之第一部&#xff0c;Aragog是海格养的蜘蛛的名字&#xff0c; 并且又牵扯到了密室 2、渗透过程 确定靶机ip&#xff0c;攻击机ip&#xff0c;扫描靶机开放端口 只有22&#xff0c;80端口&a…

数学建模常用模型(一):灰色预测法

数学建模常用模型&#xff08;一&#xff09;&#xff1a;灰色预测法 灰色预测法是一种用于处理少量数据、数据质量较差或者缺乏历史数据的预测方法。它适用于一些非线性、非平稳的系统&#xff0c;尤其在短期预测和趋势分析方面有着广泛的应用。灰色预测法作为一种强大的数学…

辅助驾驶功能开发-功能算法篇(3)-ACC-弯道速度辅助

1、功能架构:ACC弯道速度辅助(CSA) 2、CSA功能控制 2.1 要求 2.1.1 CSA ASM:弯道速度辅助 1. 模式管理器:驾驶员应能够激活/关闭功能 应存在处理 CSA 功能的模式管理器。模式管理器由驾驶员输入和系统状态控制。 模式管理器有两个由 CSAStatus 定义的状态。状态转换定义…

RabbitMQ高阶使用消息推送

目录 1 从打车开始说起1.1 需要解决的问题1.2 消息推送 2 消息推送2.1 什么是消息推送2.2 方案介绍2.2.1 ajax短轮询2.2.2 长轮询2.2.3 WebSocket 2.3 WS实现消息推送2.3.1 架构介绍2.3.2 暂存数据2.3.2.1 什么是MongoDB2.3.2.2 插入数据2.3.2.3 查询数据 2.4.1 轮询任务2.4.1.…

软件工程导论期末急救包(上)

目录 什么是软件工程&#xff1f;它的目标和内容是什么&#xff1f; 软件文档作用及包含 软件过程模型 瀑布模型 快速原型模型 增量模型 螺旋模型 喷泉模型 软件生存周期 需求分析阶段的基本任务是什么&#xff1f; 可行性研究的任务是什么&#xff1f; 软件是什…

vue+el-select下拉实现:全选、反选、清空功能

问题描述&#xff1a; el-select下拉框要求实现全选功能。具体功能包括&#xff1a; 当选择【全选】时&#xff0c;所有选项全部被勾选&#xff1b;当选择【反选】时&#xff0c;已选择选项变为未选择选项&#xff0c;未选项变为已选项当选择【清空】时&#xff0c;所有选项变…

带你用Python制作7个程序,让你感受到端午节的快乐

名字&#xff1a;阿玥的小东东 学习&#xff1a;Python、C/C 主页链接&#xff1a;阿玥的小东东的博客_CSDN博客-python&&c高级知识,过年必备,C/C知识讲解领域博主 目录 前言 程序1&#xff1a;制作粽子 程序2&#xff1a;龙舟比赛 程序3&#xff1a;艾草挂 程序4…

【人脸检测0】视频分解图片与图片合成视频

一,引言 目标:这小节主要通过两个demo熟悉视频分解图片与图片合成视频的OpenCV的应用 环境:python3.6+OpenCV3.3.1 二,示例 Demo1:视频分解图片 目标: 1.指定文件夹中读取视频文件 2.将视频文件分解为图片 3.将图片保存在指定文件夹中 # -*-coding:utf-8-*- #auth…

澳洲学生用ChatGPT代写?澳洲多所高校使用全新反击工具检测

朋友们听句劝 ChatGPT可太危险了 ChatGPT有多火&#xff1f;据2月1日瑞银发布的一项研究报告显示&#xff0c;仅仅发布两个月&#xff0c;ChatGPT月活跃用户已达1亿&#xff0c;这是历史上增长速度最快的应用。要知道达成1亿用户的时间&#xff0c;Instagram用了2.5年&#xf…

合宙Air724UG Cat.1模块硬件设计指南--SDIO接口

SDIO接口 简介 SDIO(Secure Digital Input and Output)全称为安全数字输入输出接口&#xff0c;在协议上和SPI类似是一种串行的硬件接口&#xff0c;通信的双方一个作为HOST&#xff0c;另一端是Device&#xff0c;所有的通信都是由HOST端发送命令开始的&#xff0c;Device端只…

Stable Diffusion实操示例

一、负向提示词 解决问题&#xff1a;生成的图片存在瑕疵&#xff0c;比如多只眼睛、多只手指等情况。通过embeddings可以避免一些常用的不好结果。 方法&#xff1a;从https://civitai.com/?utm_sourcenettsz.com 中下载负向提示词的embeddings模型&#xff0c; EasyNegat…

广角积分球均匀光源

现阶段&#xff0c;摄影测量技术已涉及多行多业&#xff0c;其在交通、考古以及景物三维重建中的应用尤为显著&#xff0c;但是普通相机取景范围有限&#xff0c;不能全面捕获整个空间信息&#xff0c;因此一种新型相机--全景相机逐步被应用到实际当中。80年代初&#xff0c;国…

R语言 tidyverse系列学习笔记(系列5)dplyr 数据分析之across

成绩单 score install.packages("dplyr") library(dplyr)install.packages("tibble") library(tibble)install.packages("stringr") library(stringr)score tibble(IDc("1222-1","2001-0","3321-1","4898-…

MATLAB|主动噪声和振动控制算法——对较大的次级路径变化具有鲁棒性

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…

STM32-I2C通信在AT24C02的应用

AT24C02是一种失去电源供给后依旧能保持数据的储存器&#xff0c;常用来储存一些配置信息&#xff0c;在系统重新上电之后也可以加载。它的容量是2k bit的EEPROM存储器&#xff0c;采用I2C通信方式。 AT24C02支持两种写操作&#xff1a;字节写操作和页写操作。本实验中我们采用…

数据结构算法 -分而治之算法

引言 坤坤是一个养鸡场的员工&#xff0c;他非常热爱他的工作&#xff0c;并且总是努力提高他的专业技能。有一天&#xff0c;养鸡场接到了一项任务&#xff1a;在短时间内处理一批大量的鸡。 这批鸡数量非常大&#xff0c;比普通的数量要多得多&#xff0c;坤坤意识到他们需…

C++核心编程——详解函数模板

纵有疾风起&#xff0c;人生不言弃。本文篇幅较长&#xff0c;如有错误请不吝赐教&#xff0c;感谢支持。 &#x1f4ac;文章目录 一.模板的基础知识①为什么有模板&#xff1f;②初识模板 二.函数模板①函数模板的定义②函数模板的使用③函数模板实例化1️⃣隐式实例化2️⃣显…