vue3 setup语法糖 搜索

news2025/1/12 14:01:24

目录

前言

用法

1. 区域

前言

Vue.js 是一款流行的 JavaScript 框架,用于构建用户界面。它提供了一种简洁的方式来创建可维护和可测试的前端应用程序。Vue.js 的核心库只关注视图层,易于上手,同时与其他库或现有项目整合也非常方便。Vue 也完全能够为复杂的单页应用提供驱动。

在 Vue 3 中,引入了 <script setup> 语法,这是一种更简洁、更快速的方式来编写组件。这种语法使得组件的编写变得更加简单和直观,同时也提高了代码的可读性和维护性。

在这个例子中,我们将使用 Vue 3 和 <script setup> 语法来创建一个简单的搜索组件,展示如何利用 Vue 的响应式系统和计算属性来实现实时搜索功能。

用法

<template>
  <div>
    <input v-model="searchQuery" placeholder="Search..." />
    <ul v-if="filteredData.length > 0">
      <li v-for="item in filteredData" :key="item.id">
        {{ item.title }} - {{ item.nickname }}
      </li>
    </ul>
    <p v-else>No results found</p>
  </div>
</template>
1. <template> 区域

<template> 区域中,我们定义了组件的 HTML 结构:

  • 一个 input 元素,用于输入搜索查询。我们使用 v-model 指令将其值双向绑定到 searchQuery 变量。
  • 一个 ul 列表,用于显示搜索结果。我们使用 v-if 指令来判断 filteredData 数组是否有内容,如果有,就显示搜索结果。
  • ul 列表内部,我们使用 v-for 指令来遍历 filteredData 数组,并为每个结果创建一个 li 元素。
  • 如果 filteredData 数组为空,我们显示一条 "No results found" 的消息。

<script setup>
import { ref, computed } from 'vue';

const searchQuery = ref('');

const data = ref([
		{
			"id": 89,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092410299525",
			"create_time": "2023-09-24 19:52:47",
			"status": 1,
			"nickname": "昵称",
			"tel": "1527",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 88,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092499519710",
			"create_time": "2023-09-24 08:48:44",
			"status": 1,
			"nickname": "昵称",
			"tel": "663177",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 87,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092497515653",
			"create_time": "2023-09-24 08:44:42",
			"status": 1,
			"nickname": "昵称",
			"tel": "1523",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 86,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092457100101",
			"create_time": "2023-09-24 08:44:41",
			"status": 1,
			"nickname": "昵称",
			"tel": "152366",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 85,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092448101101",
			"create_time": "2023-09-24 08:40:32",
			"status": 1,
			"nickname": "昵称",
			"tel": "152366",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 84,
			"shopid": 9,
			"userid": 21,
			"total": "1",
			"num": "1",
			"ord_num": "2023092456545351",
			"create_time": "2023-09-24 07:53:12",
			"status": 1,
			"nickname": "昵称",
			"tel": "1523677",
			"title": "魅鹰视力机德国技术a波光谱眼部按摩仪护眼仪儿童近散眼轴学生",
			"price": "1",
			"info": "儿童养眼"
		},
		{
			"id": 83,
			"shopid": 9,
			"userid": 21,
			"total": "1",
			"num": "1",
			"ord_num": "2023092448101545",
			"create_time": "2023-09-24 07:44:16",
			"status": 1,
			"nickname": "昵称",
			"tel": "15237",
			"title": "魅鹰视力机德国技术a波光谱眼部按摩仪护眼仪儿童近散眼轴学生",
			"price": "1",
			"info": "儿童养眼"
		},
		{
			"id": 82,
			"shopid": 3,
			"userid": 2,
			"total": "1",
			"num": "1",
			"ord_num": "2023091456535451",
			"create_time": "2023-09-14 14:46:16",
			"status": 1,
			"nickname": "冰海恋雨",
			"tel": "1522599",
			"title": "顺丰包邮10斤混合组合混搭新鲜水果进口车厘子礼盒装中秋送礼高端",
			"price": "999",
			"info": "非常热爆"
		},
		{
			"id": 81,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091310156515",
			"create_time": "2023-09-13 07:46:06",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 80,
			"shopid": 1,
			"userid": 9,
			"total": "10",
			"num": "1",
			"ord_num": "2023091251571024",
			"create_time": "2023-09-12 23:36:03",
			"status": 1,
			"nickname": "志昂张",
			"tel": "17839859856",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 79,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091210297569",
			"create_time": "2023-09-12 18:55:59",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 78,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091249101575",
			"create_time": "2023-09-12 18:38:09",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 77,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091253575549",
			"create_time": "2023-09-12 18:37:41",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 76,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091297971021",
			"create_time": "2023-09-12 18:16:58",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 75,
			"shopid": 10,
			"userid": 4,
			"total": "13.8",
			"num": "1",
			"ord_num": "2023091210255505",
			"create_time": "2023-09-12 18:14:55",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "紫薯新鲜9斤农家蜜薯板栗香红沙地薯地瓜糖心蔬菜山芋小番薯包邮",
			"price": "13.8",
			"info": "紫薯新鲜9斤农家蜜薯板栗香红沙地薯地瓜糖心蔬菜山芋小番薯包邮"
		},
		{
			"id": 74,
			"shopid": 4,
			"userid": 4,
			"total": "1",
			"num": "1",
			"ord_num": "2023091210048559",
			"create_time": "2023-09-12 18:14:37",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "正版 华晨宇同款李宁防泼水外套 | 2023秋季新款开衫防风运动服男女款",
			"price": "1",
			"info": "好穿不贵"
		},
		{
			"id": 73,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091250501011",
			"create_time": "2023-09-12 17:44:18",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 72,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091210048491",
			"create_time": "2023-09-12 17:42:53",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		}

]);

const filteredData = computed(() => {
  if (!searchQuery.value) {
    return data.value;
  }
  return data.value.filter(item => {
    return Object.values(item).some(value =>
      value.toString().toLowerCase().includes(searchQuery.value.toLowerCase())
    );
  });
});
</script>
2. <script setup> 区域

<script setup> 区域中,我们定义了组件的 JavaScript 逻辑:

  • 首先,我们从 vue 中导入了 refcomputed 函数。
  • 然后,我们定义了 searchQuery 变量,用 ref 函数创建一个响应式引用,并初始化为空字符串。
  • 我们还定义了 data 变量,用 ref 函数创建一个响应式引用,并初始化为给定的假数据数组。
  • 接下来,我们定义了 filteredData 计算属性,它根据 searchQuery 的值来过滤 data 数组,并返回匹配的结果。我们使用 Object.values(item).some() 来检查对象中的所有值是否有任何一个包含搜索字符串。

理解

1. 响应式系统

Vue 的响应式系统是其核心特性之一。在这个例子中,searchQuerydata 都是响应式引用,这意味着当它们的值发生变化时,Vue 会自动重新渲染组件。这使得我们能够实现实时搜索功能,用户在输入框中输入时,搜索结果会立即更新。

2. 计算属性

filteredData 是一个计算属性,它依赖于 searchQuerydata 的值。当这些依赖项的值发生变化时,Vue 会自动重新计算 filteredData 的值。计算属性是缓存的,只有当其依赖项发生变化时,它们的值才会被重新计算。这使得计算属性非常高效,特别是当进行复杂计算或过滤大量数据时。

3. <script setup> 语法

<script setup> 语法是 Vue 3 中引入的一种新的组件编写方式。它提供了一种更简洁、更快速的方式来定义组件。在 <script setup> 中,我们可以直接定义组件的 props、setup 函数和其他组合式 API,无需使用 export default 来导出组件对象。这种语法使得组件的结构更加清

完整代码

<template>
  <div>
    <input v-model="searchQuery" placeholder="Search..." />
    <ul v-if="filteredData.length > 0">
      <li v-for="item in filteredData" :key="item.id">
        {{ item.title }} - {{ item.nickname }}
      </li>
    </ul>
    <p v-else>No results found</p>
  </div>
</template>

<script setup>
import { ref, computed } from 'vue';

const searchQuery = ref('');

const data = ref([
		{
			"id": 89,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092410299525",
			"create_time": "2023-09-24 19:52:47",
			"status": 1,
			"nickname": "昵称",
			"tel": "1527",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 88,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092499519710",
			"create_time": "2023-09-24 08:48:44",
			"status": 1,
			"nickname": "昵称",
			"tel": "15236",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 87,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092497515653",
			"create_time": "2023-09-24 08:44:42",
			"status": 1,
			"nickname": "昵称",
			"tel": "1577",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 86,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092457100101",
			"create_time": "2023-09-24 08:44:41",
			"status": 1,
			"nickname": "昵称",
			"tel": "177",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 85,
			"shopid": 13,
			"userid": 21,
			"total": "99.00",
			"num": "1",
			"ord_num": "2023092448101101",
			"create_time": "2023-09-24 08:40:32",
			"status": 1,
			"nickname": "昵称",
			"tel": "177",
			"title": "11苹果11双卡全面屏苹果手机",
			"price": "99.00",
			"info": "推荐购买"
		},
		{
			"id": 84,
			"shopid": 9,
			"userid": 21,
			"total": "1",
			"num": "1",
			"ord_num": "2023092456545351",
			"create_time": "2023-09-24 07:53:12",
			"status": 1,
			"nickname": "昵称",
			"tel": "157",
			"title": "魅鹰视力机德国技术a波光谱眼部按摩仪护眼仪儿童近散眼轴学生",
			"price": "1",
			"info": "儿童养眼"
		},
		{
			"id": 83,
			"shopid": 9,
			"userid": 21,
			"total": "1",
			"num": "1",
			"ord_num": "2023092448101545",
			"create_time": "2023-09-24 07:44:16",
			"status": 1,
			"nickname": "昵称",
			"tel": "15",
			"title": "魅鹰视力机德国技术a波光谱眼部按摩仪护眼仪儿童近散眼轴学生",
			"price": "1",
			"info": "儿童养眼"
		},
		{
			"id": 82,
			"shopid": 3,
			"userid": 2,
			"total": "1",
			"num": "1",
			"ord_num": "2023091456535451",
			"create_time": "2023-09-14 14:46:16",
			"status": 1,
			"nickname": "冰海恋雨",
			"tel": "15225928729",
			"title": "顺丰包邮10斤混合组合混搭新鲜水果进口车厘子礼盒装中秋送礼高端",
			"price": "999",
			"info": "非常热爆"
		},
		{
			"id": 81,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091310156515",
			"create_time": "2023-09-13 07:46:06",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 80,
			"shopid": 1,
			"userid": 9,
			"total": "10",
			"num": "1",
			"ord_num": "2023091251571024",
			"create_time": "2023-09-12 23:36:03",
			"status": 1,
			"nickname": "志昂张",
			"tel": "17839859856",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 79,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091210297569",
			"create_time": "2023-09-12 18:55:59",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 78,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091249101575",
			"create_time": "2023-09-12 18:38:09",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 77,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091253575549",
			"create_time": "2023-09-12 18:37:41",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 76,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091297971021",
			"create_time": "2023-09-12 18:16:58",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 75,
			"shopid": 10,
			"userid": 4,
			"total": "13.8",
			"num": "1",
			"ord_num": "2023091210255505",
			"create_time": "2023-09-12 18:14:55",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "紫薯新鲜9斤农家蜜薯板栗香红沙地薯地瓜糖心蔬菜山芋小番薯包邮",
			"price": "13.8",
			"info": "紫薯新鲜9斤农家蜜薯板栗香红沙地薯地瓜糖心蔬菜山芋小番薯包邮"
		},
		{
			"id": 74,
			"shopid": 4,
			"userid": 4,
			"total": "1",
			"num": "1",
			"ord_num": "2023091210048559",
			"create_time": "2023-09-12 18:14:37",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "正版 华晨宇同款李宁防泼水外套 | 2023秋季新款开衫防风运动服男女款",
			"price": "1",
			"info": "好穿不贵"
		},
		{
			"id": 73,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091250501011",
			"create_time": "2023-09-12 17:44:18",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		},
		{
			"id": 72,
			"shopid": 1,
			"userid": 4,
			"total": "10",
			"num": "1",
			"ord_num": "2023091210048491",
			"create_time": "2023-09-12 17:42:53",
			"status": 1,
			"nickname": "李四",
			"tel": "15225928720",
			"title": "Jordan官方耐克乔丹AJ38男子实战篮球鞋秋新款透气缓震抗扭FN7482",
			"price": "10",
			"info": "AJ"
		}

]);

const filteredData = computed(() => {
  if (!searchQuery.value) {
    return data.value;
  }
  return data.value.filter(item => {
    return Object.values(item).some(value =>
      value.toString().toLowerCase().includes(searchQuery.value.toLowerCase())
    );
  });
});
</script>

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

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

相关文章

解决Maven打包Nacos时插件报错

Maven打包指令&#xff1a;mvn clean install -Dmaven.test.skiptrue -Dcheckstyle.skiptrue 在执行时报错&#xff0c;报错信息如下&#xff1a; Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project nacos-consist…

C语言——有一篇文章,共有 3 行文字,每行有 80 个字符。要求分别统计出其中英文大写字母、小写字母、数字、空格以及其他字符的个数

完整代码&#xff1a; /* 有一篇文章&#xff0c;共有 3 行文字&#xff0c;每行有 80 个字符。要求分别统计出其中英文大写字母、 小写字母、数字、空格以及其他字符的个数*/#include<stdio.h> int main(){//创建一篇这样的文章到二维字符数组中char str[3][80] {&quo…

平面图欧拉公式

V − E P B 1 V-EPB1 V−EPB1 V V V &#xff1a;点数 E E E&#xff1a;边数 P P P&#xff1a;面数&#xff08;含外面&#xff09; B B B&#xff1a;连通块数量 通过这个我们可以处理网格图中的连通块数量问题 上图中有7个点&#xff0c;8条边&#xff0c;3个面&#x…

小红书推广高客单产品的技巧与方法

小红书作为流量市场的一块洼地&#xff0c;这里汇聚着高净值高月活的年轻女性用户&#xff0c;她们更关注高品质、高口碑的优质产品。 在这样的营销氛围下&#xff0c;越来越多高单价产品将目光聚到这里&#xff0c;通过品牌精准营销&#xff0c;有效提升产品曝光和口碑&#x…

HighCharts点击无响应问题

HighCharts 点击无响应问题 背景介绍 项目需要展示一个小时内日志设备的状态&#xff0c;由于数据量比较大&#xff0c;使用echarts效果不好。于是采用highcharts来处理显示。highcharts使用起来很方便&#xff0c;还有打印照片功能&#xff0c;相当满意。这里采用官网给的例…

jsp初学

指令标识 html java代码 out内置对象,直接拿过来用 注释 <%-- 注释内容 --%>:JSP提供了隐藏注释&#xff0c;隐藏注释不仅在浏览器页面中看不到&#xff0c;在查看HTML源代码时也看不到 动态注释,网页看不到,只能看源码<!-- <%new Date()%> --> 指令 …

springboot配置redis、Spring cache

1.Jedis库 依赖库 <dependency><groupId>redis.clients</groupId><artifactId>jedis</artifactId><version>5.0.2</version> </dependency>使用案例&#xff1a; Testpublic void jedis(){Jedis jedis new Jedis("127…

【ceph】ceph集群的节点机器重启,导致磁盘的lvm消失,如何恢复呢~~满满的都是干货

本站以分享各种运维经验和运维所需要的技能为主 《python零基础入门》&#xff1a;python零基础入门学习 《python运维脚本》&#xff1a; python运维脚本实践 《shell》&#xff1a;shell学习 《terraform》持续更新中&#xff1a;terraform_Aws学习零基础入门到最佳实战 《k8…

用python写一个俄罗斯方块程序

用python写一个俄罗斯方块程序 1.源代码2.游戏运行 1.源代码 import pygame import random# 初始化游戏 pygame.init()# 游戏窗口尺寸 WINDOW_WIDTH 800 WINDOW_HEIGHT 600# 方块大小和颜色 BLOCK_SIZE 30 COLORS [(0, 0, 0), # 黑色(255, 0, 0), # 红色(0, 255, 0), #…

补码为什么要+1

关于补码的文章&#xff0c;csdn上面遍地都是&#xff0c;所以我们大可不必搬运别人的文章来装点门面&#xff0c;我写这篇博客是想补充一个问题“补码为什么要1”的问题&#xff0c;这个问题&#xff0c;博客园有个叫张子秋的文章写的很好&#xff0c;但是最后对补码为什么1的…

【VASP】POTCAR文件

【VASP】POTCAR文件 POTCAR 文件的介绍qvasp 生成POTCARvaspkit 生成POTCAR再来认识一下各种赝势如何区分US、PAW、LDA、GGA、PW91 前言 一、4个常用的输入文件INCAR、POSCAR、POTCAR、KPOINTS INCAR: 计算任务类型是什么&#xff1f;怎么计算&#xff1f; KPOINTS: 包含了倒易…

Decomposed Meta-Learning for Few-Shot Named Entity Recognition

原文链接&#xff1a; https://aclanthology.org/2022.findings-acl.124.pdf ACL 2022 介绍 问题 目前基于span的跨度量学习&#xff08;metric learning&#xff09;的方法存在一些问题&#xff1a; 1&#xff09;由于是通过枚举来生成span&#xff0c;因此在解码的时候需要额…

Zoho Mail荣登福布斯2023年企业邮箱榜单,引领行业新方向!

几十年来&#xff0c;电子邮件一直是电子通信的重要形式&#xff0c;并且在未来的许多年里&#xff0c;它可能会无处不在。尽管有大量免费电子邮件服务可供用户和企业使用&#xff0c;但其中许多服务缺乏专门的功能&#xff0c;例如适合办公室使用的集中管理。 福布斯小型企业顾…

S5PV210裸机(七):Nand和iNand

本文主要探讨210Nand和iNand相关知识。 NandFlash 型号与命 K9F2G08&#xff1a;K9F为发行商,2G为Nand大小是2Gbit(256MB),08为Nand是8位(8数据线即接口为8位:传输数据,地址,命令) 功能 Nand是矩阵式存储,每块可存1bit位 …

3.SpringSecurity基于数据库的认证与授权

文章目录 SpringSecurity基于数据库的认证与授权一、自定义用户信息UserDetails1.1 新建用户信息类UserDetails1.2 UserDetailsService 二、基于数据库的认证2.1 连接数据库2.2 获取用户信息2.2.1 获取用户实体类2.2.2 Mapper2.2.3 Service 2.3 认证2.3.1 实现UserDetails接口2…

探索跨境电商产品开发流程的最佳工具

产品是跨境电商行业的核心竞争力&#xff0c;一个完整的新产品开发过程&#xff0c;大致要经历创意生成 - 创意筛选 - 产品概念开发与测试 - 营销策划 - 业务分析 - 产品实体开发 - 试销 - 商业化这8个阶段。 上述每个阶段都很重要且需要在实操中不断完善&#xff0c;当中涉及…

十九、类型信息(1)

本章概要 为什么需要 RTTI RTTI&#xff08;RunTime Type Information&#xff0c;运行时类型信息&#xff09;能够在程序运行时发现和使用类型信息 RTTI 把我们从只能在编译期进行面向类型操作的禁锢中解脱了出来&#xff0c;并且让我们可以使用某些非常强大的程序。对 RTTI …

Active learning Tiny Review for autonomous driving

Introduction 阅读某一特定主题的一本书不会使你成为专家&#xff0c;阅读多本包含相似内容的书也不会。真正掌握一项技能或领域的知识需要来自多样化信息源的大量信息。 这对于自动驾驶和其他人工智能技术同样适用。 负责自动驾驶功能的深度神经网络需要经过详尽的训练&#…

ES 数据迁移最佳实践

ES 数据迁移最佳实践与讲解 数据迁移是 Elasticsearch 运维管理和业务需求中常见的操作之一。以下是不同数据迁移方法的最佳实践和讲解&#xff1a; 一、数据迁移需求梳理 二、数据迁移方法梳理 三、各方案对比 方案 优点 缺点&#xff08;限制&#xff09; 适用场景 是否有…

Lua脚本语言

1. 概念 Lua&#xff08;发音为"loo-ah"&#xff0c;葡萄牙语中的"lua"意为月亮&#xff09;是一种轻量级的、高效的、可嵌入的脚本编程语言。官网Lua最初由巴西计算机科学家Roberto Ierusalimschy、Waldemar Celes和Luiz Henrique de Figueiredo于1993年开…