Element Plus 常用组件

news2025/7/12 16:47:30

2025/4/1

 向全栈工程师迈进!!!

常见Element Plus组件的使用,其文章中本次我使用到的按钮如下”是我自己做项目时候用到的,记录以加强记忆。阅读时可以跳过。

一、Button按钮

1.1基础按钮

在element plus中提供的按钮种类很多,我们可以使用 typeplainround 和 circle 来定义按钮的样式,如下所示。

1.1.1 其基本代码如下:

<template>
  <div class="mb-4">
    <el-button>Default</el-button>
    <el-button type="primary">Primary</el-button>
    <el-button type="success">Success</el-button>
    <el-button type="info">Info</el-button>
    <el-button type="warning">Warning</el-button>
    <el-button type="danger">Danger</el-button>
  </div>

  <div class="mb-4">
    <el-button plain>Plain</el-button>
    <el-button type="primary" plain>Primary</el-button>
    <el-button type="success" plain>Success</el-button>
    <el-button type="info" plain>Info</el-button>
    <el-button type="warning" plain>Warning</el-button>
    <el-button type="danger" plain>Danger</el-button>
  </div>

  <div class="mb-4">
    <el-button round>Round</el-button>
    <el-button type="primary" round>Primary</el-button>
    <el-button type="success" round>Success</el-button>
    <el-button type="info" round>Info</el-button>
    <el-button type="warning" round>Warning</el-button>
    <el-button type="danger" round>Danger</el-button>
  </div>

  <div>
    <el-button :icon="Search" circle />
    <el-button type="primary" :icon="Edit" circle />
    <el-button type="success" :icon="Check" circle />
    <el-button type="info" :icon="Message" circle />
    <el-button type="warning" :icon="Star" circle />
    <el-button type="danger" :icon="Delete" circle />
  </div>
</template>

<script lang="ts" setup>
import {
  Check,
  Delete,
  Edit,
  Message,
  Search,
  Star,
} from '@element-plus/icons-vue'
</script>

 本次我使用到的按钮如下,其属性type为 “primary” 。即第一行的第二个按钮。

<el-button type="primary" @click="handleFilter">
    <svg-icon icon-class="search" style="margin-right: 5px" />查询
</el-button>

1.1.2 使用disable属性禁用按钮

<div class="mb-4">
    <el-button disabled>Default</el-button>
    <el-button type="primary" disabled>Primary</el-button>
    <el-button type="success" disabled>Success</el-button>
    <el-button type="info" disabled>Info</el-button>
    <el-button type="warning" disabled>Warning</el-button>
    <el-button type="danger" disabled>Danger</el-button>
</div>

1.2图标按钮

图标按钮如下 

<template>
  <div>
    <el-button type="primary" :icon="Edit" />
    <el-button type="primary" :icon="Share" />
    <el-button type="primary" :icon="Delete" />
    <el-button type="primary" :icon="Search">Search</el-button>
    <el-button type="primary">
      Upload<el-icon class="el-icon--right"><Upload /></el-icon>
    </el-button>
  </div>
</template>

<script setup lang="ts">
import { Delete, Edit, Search, Share, Upload } from '@element-plus/icons-vue'
</script>

通过icon属性添加图标,当然要添加的图标需要在script中引入相应的图标。当然引入图标的方式还可以是第5个按钮的引入方式,通过<el-icon> 的方式引入,其<Upload />就是导入的图标组件。通过组件<el-icon>来显示组件。

本次我使用到的按钮如下,其属性type为 “primary” 。通过<svg-icon />的方式添加图标,通过icon-class指定引入图标。

<el-button type="primary" @click="handleCreate">
    <svg-icon icon-class="plus" style="margin-right: 5px" />新增
</el-button>

 1.3按键组

其显示效果如下 

<template>
  <el-button-group>
    <el-button type="primary" :icon="ArrowLeft">Previous Page</el-button>
    <el-button type="primary">
      Next Page<el-icon class="el-icon--right"><ArrowRight /></el-icon>
    </el-button>
  </el-button-group>

  <el-button-group class="ml-4">
    <el-button type="primary" :icon="Edit" />
    <el-button type="primary" :icon="Share" />
    <el-button type="primary" :icon="Delete" />
  </el-button-group>
</template>

<script setup lang="ts">
import {
  ArrowLeft,
  ArrowRight,
  Delete,
  Edit,
  Share,
} from '@element-plus/icons-vue'
</script>

首先是使用了<el-button-group></el-button-group>表示是一个按键组,在其内部写多个<el-button>就可以将这些按钮成为一个组。

2、为按钮调节大小

 通过size属性调节显示大小。

<template>
  <div class="flex flex-wrap items-center mb-4">
    <el-button size="large">Large</el-button>
    <el-button>Default</el-button>
    <el-button size="small">Small</el-button>
    <el-button size="large" :icon="Search">Search</el-button>
    <el-button :icon="Search">Search</el-button>
    <el-button size="small" :icon="Search">Search</el-button>
  </div>
  <div class="flex flex-wrap items-center mb-4">
    <el-button size="large" round>Large</el-button>
    <el-button round>Default</el-button>
    <el-button size="small" round>Small</el-button>
    <el-button size="large" :icon="Search" round>Search</el-button>
    <el-button :icon="Search" round>Search</el-button>
    <el-button size="small" :icon="Search" round>Search</el-button>
  </div>
  <div class="flex flex-wrap items-center">
    <el-button :icon="Search" size="large" circle />
    <el-button :icon="Search" circle />
    <el-button :icon="Search" size="small" circle />
  </div>
</template>

<script setup lang="ts">
import { Search } from '@element-plus/icons-vue'
</script>

可以发现,默认显示效果是中等的显示效果,其可以通过改变属性为large或者small来改变显示大小。

二、输入框

2.1输入框的基础用法

<template>
  <el-input v-model="input" style="width: 240px" placeholder="Please input" />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const input = ref('')
</script>

v-model="input" 表示输入数据会和input实现数据双向绑定placeholder="Please input"placeholder 是输入框的一个属性,用于在输入框为空时显示提示文本。当用户开始输入内容时,提示文本会自动消失。

2.2一键清空

使用clearable属性即可得到一个可一键清空的输入框

<template>
  <el-input
    v-model="input"
    style="width: 240px"
    placeholder="Please input"
    clearable
  />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const input = ref('')
</script>

如下显示的就是clearable的效果。 

2.3密码框

<template>
  <el-input
    v-model="input"
    style="width: 240px"
    type="password"
    placeholder="Please input password"
    show-password
  />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
const input = ref('')
</script>

 如下显示的就是密码框输入。

2.4带图标的输入框

要在输入框中添加图标,使用 prefix-icon 和 suffix-icon 属性。 另外, prefix 和 suffix 命名的插槽也能正常工作。

<template>
  <div class="flex gap-4 mb-4">
    <span>Using attributes</span>
    <el-input
      v-model="input1"
      style="width: 240px"
      placeholder="Pick a date"
      :suffix-icon="Calendar"
    />
    <el-input
      v-model="input2"
      style="width: 240px"
      placeholder="Type something"
      :prefix-icon="Search"
    />
  </div>
  <div class="flex gap-4">
    <span>Using slots</span>
    <el-input v-model="input3" style="width: 240px" placeholder="Pick a date">
      <template #suffix>
        <el-icon class="el-input__icon"><calendar /></el-icon>
      </template>
    </el-input>
    <el-input
      v-model="input4"
      style="width: 240px"
      placeholder="Type something"
    >
      <template #prefix>
        <el-icon class="el-input__icon"><search /></el-icon>
      </template>
    </el-input>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Calendar, Search } from '@element-plus/icons-vue'
const input1 = ref('')
const input2 = ref('')
const input3 = ref('')
const input4 = ref('')
</script>

 通过suffix-icon添加图标。

本次我使用到的输入框如下,其绑定的输入数据为listQuery.inspectionCode。

<el-input v-model="listQuery.inspectionCode" v-trim placeholder="请输入检验代码" style="width: 200px" clearable @keyup.enter.native="handleFilter" />

三、Table 表格

3.1基础表格

<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column prop="date" label="Date" width="180" />
    <el-table-column prop="name" label="Name" width="180" />
    <el-table-column prop="address" label="Address" />
  </el-table>
</template>

<script lang="ts" setup>
const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
</script>

<el-table :data="tableData" style="width: 100%">中的:data表示的就是动态注入的数据,在每一列<el-table-column prop="date" label="Date" width="180" />中通过prop="date"再绑定对应对象中的键名。同时label属性是为显示的表格的列名。

3.2带斑马纹表格

在<el-table>中加入 stripe 就可以让表格显示为斑马纹。

<el-table :data="tableData" stripe style="width: 100%">

如下所示

 3.3带边框表格

默认情况下,Table 组件是不具有竖直方向的边框的, 如果需要,可以使用 border 属性,把该属性设置为 true 即可启用。

<el-table :data="tableData" border style="width: 100%">

 3.4带状态表格

可将表格内容 highlight 显示,方便区分「成功、信息、警告、危险」等内容。

可以通过指定 Table 组件的 row-class-name 属性来为 Table 中的某一行添加 class, 这样就可以自定义每一行的样式了。

<template>
  <el-table
    :data="tableData"
    style="width: 100%"
    :row-class-name="tableRowClassName"
  >
    <el-table-column prop="date" label="Date" width="180" />
    <el-table-column prop="name" label="Name" width="180" />
    <el-table-column prop="address" label="Address" />
  </el-table>
</template>

<script lang="ts" setup>
interface User {
  date: string
  name: string
  address: string
}

const tableRowClassName = ({
  row,
  rowIndex,
}: {
  row: User
  rowIndex: number
}) => {
  if (rowIndex === 1) {
    return 'warning-row'
  } else if (rowIndex === 3) {
    return 'success-row'
  }
  return ''
}

const tableData: User[] = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
</script>

<style>
.el-table .warning-row {
  --el-table-tr-bg-color: var(--el-color-warning-light-9);
}
.el-table .success-row {
  --el-table-tr-bg-color: var(--el-color-success-light-9);
}
</style>
  •  var(--el-color-warning-light-9) 是背景颜色设置为 Element UI 中警告色的浅 9 级变体。
  • var(--el-color-success-light-9) 是背景颜色设置为 Element UI 中成功色的浅 9 级变体。

3.5 固定

3.5.1 固定表头

 只需要添加上height,就可以实现固定表头的表格。

<el-table :data="tableData" height="250" style="width: 100%">

3.5.2 固定列

 通过在<el-table-column fixed prop="date" label="Date" width="150" />添加fixed。就可以实现对某列实现固定。

<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column fixed prop="date" label="Date" width="150" />
    <el-table-column prop="name" label="Name" width="120" />
    <el-table-column prop="state" label="State" width="120" />
    <el-table-column prop="city" label="City" width="120" />
    <el-table-column prop="address" label="Address" width="600" />
    <el-table-column prop="zip" label="Zip" width="120" />
    <el-table-column fixed="right" label="Operations" min-width="120">
      <template #default>
        <el-button link type="primary" size="small" @click="handleClick">
          Detail
        </el-button>
        <el-button link type="primary" size="small">Edit</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
const handleClick = () => {
  console.log('click')
}

const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Home',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Office',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Home',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
    tag: 'Office',
  },
]
</script>

3.5.3 固定列和表头

<template>
  <el-table :data="tableData" style="width: 100%" height="250">
    <el-table-column fixed prop="date" label="Date" width="150" />
    <el-table-column prop="name" label="Name" width="120" />
    <el-table-column prop="state" label="State" width="120" />
    <el-table-column prop="city" label="City" width="320" />
    <el-table-column prop="address" label="Address" width="600" />
    <el-table-column prop="zip" label="Zip" />
  </el-table>
</template>

<script lang="ts" setup>
const tableData = [
  {
    date: '2016-05-03',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-08',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-06',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
  {
    date: '2016-05-07',
    name: 'Tom',
    state: 'California',
    city: 'Los Angeles',
    address: 'No. 189, Grove St, Los Angeles',
    zip: 'CA 90036',
  },
]
</script>

 3.6 筛选

<template>
  <el-button @click="resetDateFilter">reset date filter</el-button>
  <el-button @click="clearFilter">reset all filters</el-button>
  <el-table ref="tableRef" row-key="date" :data="tableData" style="width: 100%">
    <el-table-column
      prop="date"
      label="Date"
      sortable
      width="180"
      column-key="date"
      :filters="[
        { text: '2016-05-01', value: '2016-05-01' },
        { text: '2016-05-02', value: '2016-05-02' },
        { text: '2016-05-03', value: '2016-05-03' },
        { text: '2016-05-04', value: '2016-05-04' },
      ]"
      :filter-method="filterHandler"
    />
    <el-table-column prop="name" label="Name" width="180" />
    <el-table-column prop="address" label="Address" :formatter="formatter" />

    <el-table-column
      prop="tag"
      label="Tag"
      width="100"
      :filters="[
        { text: 'Home', value: 'Home' },
        { text: 'Office', value: 'Office' },
      ]"
      :filter-method="filterTag"
      filter-placement="bottom-end"
    >
      <template #default="scope">
        <el-tag
          :type="scope.row.tag === 'Home' ? 'primary' : 'success'"
          disable-transitions
          >{{ scope.row.tag }}</el-tag
        >
      </template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import type { TableColumnCtx, TableInstance } from 'element-plus'

interface User {
  date: string
  name: string
  address: string
  tag: string
}

const tableRef = ref<TableInstance>()

const resetDateFilter = () => {
  tableRef.value!.clearFilter(['date'])
}
const clearFilter = () => {
  tableRef.value!.clearFilter()
}
const formatter = (row: User, column: TableColumnCtx<User>) => {
  return row.address
}
const filterTag = (value: string, row: User) => {
  return row.tag === value
}
const filterHandler = (
  value: string,
  row: User,
  column: TableColumnCtx<User>
) => {
  const property = column['property']
  return row[property] === value
}

const tableData: User[] = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Home',
  },
  {
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Office',
  },
  {
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Home',
  },
  {
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
    tag: 'Office',
  },
]
</script>

筛选出来Tag分别为 Home 或者为 Office 的。通过如下实现

:filters="[ { text: 'Home', value: 'Home' }, { text: 'Office', value: 'Office' }, ]" 
:filter-method="filterTag"

第一个filters是定义过滤器项。通过这个数组可以为列提供多个过滤条件,filter-method: 定义过滤逻辑的方法。

 其定义的过滤函数如下:

const filterTag = (value: string, row: User) => {
  return row.tag === value
}

其参数传递到filterTag函数中,其value值是选中的值,然后传递的row就是每一行的数据,row.tag就可以访问到真实的那一行的tag值,若和选中的value相等则返回true则显示该行,否则相反。

为了让Home和Office显示的更加好看,我们可以使用插槽定义其样式,使其看起来更加的好看,定义的内容如下:

<template #default="scope">
    <el-tag
      :type="scope.row.tag === 'Home' ? 'primary' : 'success'"
      disable-transitions
    >
      {{ scope.row.tag }}
    </el-tag>
</template>

type动态绑定显示效果,和Home相等就显示为primary样式,不相等就显示为success样式。disable-transitions是禁用显示的动画效果。{{ scope.row.tag }}:在标签内部显示当前行的 tag 值。

3.7多选

<template>
  <el-table
    ref="multipleTableRef"
    :data="tableData"
    row-key="id"
    style="width: 100%"
    @selection-change="handleSelectionChange"
  >
    <el-table-column type="selection" :selectable="selectable" width="55" />
    <el-table-column label="Date" width="120">
      <template #default="scope">{{ scope.row.date }}</template>
    </el-table-column>
    <el-table-column property="name" label="Name" width="120" />
    <el-table-column property="address" label="Address" />
  </el-table>
  <div style="margin-top: 20px">
    <el-button @click="toggleSelection([tableData[1], tableData[2]])">
      Toggle selection status of second and third rows
    </el-button>
    <el-button @click="toggleSelection([tableData[1], tableData[2]], false)">
      Toggle selection status based on selectable
    </el-button>
    <el-button @click="toggleSelection()">Clear selection</el-button>
  </div>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import type { TableInstance } from 'element-plus'

interface User {
  id: number
  date: string
  name: string
  address: string
}

const multipleTableRef = ref<TableInstance>()
const multipleSelection = ref<User[]>([])

const selectable = (row: User) => ![1, 2].includes(row.id)
const toggleSelection = (rows?: User[], ignoreSelectable?: boolean) => {
  if (rows) {
    rows.forEach((row) => {
      multipleTableRef.value!.toggleRowSelection(
        row,
        undefined,
        ignoreSelectable
      )
    })
  } else {
    multipleTableRef.value!.clearSelection()
  }
}
const handleSelectionChange = (val: User[]) => {
  multipleSelection.value = val
}

const tableData: User[] = [
  {
    id: 1,
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    id: 2,
    date: '2016-05-02',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    id: 3,
    date: '2016-05-04',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    id: 4,
    date: '2016-05-01',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    id: 5,
    date: '2016-05-08',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    id: 6,
    date: '2016-05-06',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    id: 7,
    date: '2016-05-07',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
</script>
  • ref="multipleTableRef":通过 ref 引用表格实例,方便后续对表格进行操作。
  • :data="tableData":绑定表格数据,tableData 是一个包含用户信息的数组。
  • row-key="id":指定每一行的唯一标识,这里使用 id 作为行的键。
  • @selection-change="handleSelectionChange":监听表格选择状态的变化,当选择状态改变时触发 handleSelectionChange 方法。

embrace my life


embracing my life

特别喜欢的一个英文单词------embrace

difficlulties problems........ just embarcing them peacefully  

2025/4/2 CCE

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

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

相关文章

2025年优化算法:真菌生长优化算法(Fungal Growth Optimizer,FGO)

真菌生长优化算法(Fungal Growth Optimizer&#xff0c;FGO) 是发表在中科院一区期刊“ARTIFICIAL INTELLIGENCE REVIEW”&#xff08;IF&#xff1a;6.7&#xff09;的2025年3月智能优化算法 01.引言 Fungal Growth Optimizer (FGO) 是一种基于真菌生长行为的元启发式优化算法…

阿里通义千问发布全模态开源大模型Qwen2.5-Omni-7B

Qwen2.5-Omni 是一个端到端的多模态模型&#xff0c;旨在感知多种模态&#xff0c;包括文本、图像、音频和视频&#xff0c;同时以流式方式生成文本和自然语音响应。汇聚各领域最先进的机器学习模型&#xff0c;提供模型探索体验、推理、训练、部署和应用的一站式服务。https:/…

论文阅读:基于增强通用深度图像水印的混合篡改定位技术 OmniGuard

一、论文信息 论文名称:OmniGuard: Hybrid Manipulation Localization via Augmented Versatile Deep Image Watermarking作者团队:北京大学发表会议:CVPR2025论文链接:https://arxiv.org/pdf/2412.01615二、动机与贡献 动机: 随着生成式 AI 的快速发展,其在图像编辑领…

深挖 DeepSeek 隐藏玩法·智能炼金术2.0版本

前引&#xff1a;屏幕前的你还在AI智能搜索框这样搜索吗&#xff1f;“这道题怎么写”“苹果为什么红”“怎么不被发现翘课” &#xff0c;。看到此篇文章的小伙伴们&#xff01;请准备好你的思维魔杖&#xff0c;开启【霍格沃茨模式】&#xff0c;看我如何更新秘密的【知识炼金…

【新手初学】SQL注入getshell

一、引入 木马介绍&#xff1a; 木马其实就是一段程序&#xff0c;这个程序运行到目标主机上时&#xff0c;主要可以对目标进行远程控制、盗取信息等功能&#xff0c;一般不会破坏目标主机&#xff0c;当然&#xff0c;这也看黑客是否想要搞破坏。 木马类型&#xff1a; 按照功…

DAY 34 leetcode 349--哈希表.两个数组的交集

题号349 我尝试硬解失败 /*class Solution {public int[] intersection(int[] nums1, int[] nums2) {int n1nums1.length;int n2nums2.length;int sizeMath.min(n1,n2);int []arrnew int[size];int count0;for(int i0;i<n1;i){outerloop:for(int j0;j<n2;j){if(nums1[i…

14-SpringBoot3入门-MyBatis-Plus之CRUD

1、整合 13-SpringBoot3入门-整合MyBatis-Plus-CSDN博客 2、表 3、crud package com.sgu;import com.sgu.mapper.UserMapper; import com.sgu.pojo.User; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.spri…

三轴云台之相机技术篇

一、结构设计 三轴云台通常由空间上三个互相垂直的框架构成&#xff0c;包括内框&#xff08;俯仰框&#xff09;、中框&#xff08;方位框&#xff09;和外框&#xff08;横滚框&#xff09;。这些框架分别负责控制相机的俯仰运动、方位运动和横滚运动&#xff0c;从而实现对目…

Bugku-再也没有纯白的灵魂

下载文件发现是兽音先用https://roar.iiilab.com/加密flag 得到“~呜嗷嗷嗷嗷呜啊嗷啊呜呜嗷呜呜~嗷嗷~啊嗷啊呜嗷嗷~嗷~嗷~呜呜嗷呜啊啊”&#xff0c;与密文对比对比发现字段少个啊&#xff0c;并且B对应嗷&#xff0c;U对应呜&#xff0c;G对应啊&#xff0c;K对应~补充啊后…

多模态大语言模型arxiv论文略读(一)

Does Transliteration Help Multilingual Language Modeling? ➡️ 论文标题&#xff1a;Does Transliteration Help Multilingual Language Modeling? ➡️ 论文作者&#xff1a;Ibraheem Muhammad Moosa, Mahmud Elahi Akhter, Ashfia Binte Habib ➡️ 研究机构: Pennsyl…

单元测试原则之——不要模拟不属于你的类型

在单元测试中,不要模拟不属于你的类型(Don’t mock types you don’t own)是一个重要的原则。这是因为外部库或框架的类型(如第三方依赖)可能会在未来的版本中发生变化,而你的模拟可能无法反映这些变化,从而导致测试失效。 以下是一个基于Java Mockito 的示例,展示如何…

算法与数据结构面试题

算法与数据结构面试题 加油&#xff01; 考查数据结构本身 什么是数据结构 简单地说&#xff0c;数据结构是以某种特定的布局方式存储数据的容器。这种“布局方式”决定了数据结构对于某些操作是高效的&#xff0c;而对于其他操作则是低效的。首先我们需要理解各种数据结构&a…

边缘检测技术现状初探2:多尺度与形态学方法

一、多尺度边缘检测方法 多尺度边缘检测通过在不同分辨率/平滑度下分析图像&#xff0c;实现&#xff1a; 粗尺度&#xff08;大σ值&#xff09;&#xff1a;抑制噪声&#xff0c;提取主体轮廓细尺度&#xff08;小σ值&#xff09;&#xff1a;保留细节&#xff0c;检测微观…

【AI News | 20250402】每日AI进展

AI Repos 1、Dolphin 由数据海洋AI与清华大学联合研发的Dolphin多任务语音识别模型正式亮相。该模型覆盖东亚、南亚、东南亚及中东地区40余种语言&#xff0c;并支持22种汉语方言&#xff0c;训练数据量超21万小时&#xff08;含自有及开源数据&#xff09;&#xff0c;具备语…

操作系统高频(七)虚拟地址与页表

操作系统高频&#xff08;六&#xff09;虚拟地址与页表 1.什么是文件系统&#xff1f;它的作用是什么&#xff1f;⭐ 存储管理&#xff1a;文件系统负责管理计算机的存储设备&#xff0c;如硬盘、固态硬盘等。它将文件存储在这些设备上&#xff0c;并负责分配和回收存储空间…

openEuler24.03 LTS下安装Flume

目录 前提条件 下载Flume 解压 设置环境变量 修改日志文件 测试Flume 在node2安装Flume 前提条件 Linux安装好jdk Flume一般需要配合Hadoop使用&#xff0c;安装好Hadoop完全分布式集群&#xff0c;可参考&#xff1a;openEuler24.03 LTS下安装Hadoop3完全分布式 下载F…

现代几何风格网页标牌标识logo海报标题设计psai英文字体安装包 Myfonts – Gilroy Font Family

Gilroy 是一款具有几何风格的现代无衬线字体。它是原始 Qanelas 字体系列的弟弟。它有 20 种粗细、10 种直立字体和与之匹配的斜体。Light 和 ExtraBold 粗细是免费的&#xff0c;因此您可以随心所欲地使用它们。设计时考虑到了强大的 opentype 功能。每种粗细都包括扩展语言支…

ControlNet-Tile详解

一、模型功能与应用 1. 模型功能 ControlNet-Tile模型的主要功能是图像的细节增强和质量提升。它通过以下几个步骤实现这一目标&#xff1a; 语义分割&#xff1a;模型首先对输入的图像进行语义分割&#xff0c;识别出图像中不同的区域和对象。这一步是为了让模型理解图像的内…

leetcode 2873. 有序三元组中的最大值 I

欢迎关注更多精彩 关注我&#xff0c;学习常用算法与数据结构&#xff0c;一题多解&#xff0c;降维打击。 文章目录 题目描述题目剖析&信息挖掘解题思路方法一 暴力枚举法思路注意复杂度代码实现 方法二 公式拆分动态规划思路注意复杂度代码实现 题目描述 [2873] 有序三元…

RabbitMQ应用2

RabbitMQ应用2 一.实际业务逻辑订单系统中使用MQ&#xff08;不写订单系统逻辑&#xff09;1.项目的创建和准备2.代码实现ControllerConfigurationproperties 二.物流系统使用MQ&#xff08;不实现物流系统业务&#xff09;1.项目创建同订单&#xff08;一样&#xff09;2.代码…