Vue3類似百度風格搜索框組件

Vue3百度風格搜索框組件,使用vue3進行設計,亦有vue3+TS的版本。
vue3組件如下:

<template><!-- 搜索組件容器 --><div class="search-container"><!-- 百度Logo - 新樣式 --><div class="logo-container"><h1 class="logo"><span class="logo-bai">qiandu</span><span class="logo-baidu">千度</span></h1><p class="search-hint">搜索一下,你可能也不知道呀</p></div><!-- 搜索框主體 --><div class="search-box" ref="searchBox"><!-- 輸入框容器 --><div class="search-input-container"><!-- 核心搜索輸入框:v-model綁定query實現雙向數據綁定@input監聽輸入事件觸發搜索建議@keydown監聽鍵盤事件實現導航@focus獲取焦點時顯示建議列表--><inputtype="text"v-model="query"@input="handleInput"@keydown.down="onArrowDown"@keydown.up="onArrowUp"@keydown.enter="onEnter"@focus="showSuggestions = true"placeholder="請輸入搜索關鍵詞"class="search-input"/><!-- 清空按鈕 - 僅在輸入框有內容時顯示 --><button v-if="query" @click="clearInput" class="clear-btn"><i class="fas fa-times"></i></button></div><!-- 搜索按鈕 --><button @click="search" class="search-btn"><div class="camera-icon"></div><!-- <span class="soutu-btn"></span> --><i class="fas fa-search">search it!</i></button></div><!-- 搜索建議列表 --><div v-if="showSuggestions && suggestions.length > 0" class="suggestions"><!-- 遍歷建議列表:點擊建議項時觸發搜索:class綁定active類實現鍵盤導航高亮 --><div v-for="(suggestion, index) in suggestions" :key="index"@click="selectSuggestion(suggestion)":class="['suggestion-item', { active: index === activeSuggestionIndex }]"><i class="fas fa-search suggestion-icon"></i><span>{{ suggestion }}</span></div></div><!-- 搜索歷史記錄 --><div v-if="showHistory && searchHistory.length > 0" class="history"><!-- 歷史記錄標題和清空按鈕 --><div class="history-header"><span>搜索歷史</span><button @click="clearHistory" class="clear-history-btn"><i class="fas fa-trash-alt"></i> 清空</button></div><!-- 遍歷歷史記錄 --><div v-for="(item, index) in searchHistory" :key="index"@click="selectHistory(item)"class="history-item"><i class="fas fa-history history-icon"></i><span>{{ item }}</span></div></div></div>
</template><script setup>
// Vue Composition API 引入
import { ref, computed, onMounted, onUnmounted } from 'vue';// 響應式數據定義
const query = ref(''); // 搜索關鍵詞
const suggestions = ref([]); // 搜索建議列表
const showSuggestions = ref(false); // 是否顯示建議列表
const activeSuggestionIndex = ref(-1); // 當前激活的建議項索引
const searchHistory = ref([]); // 搜索歷史記錄
const showHistory = ref(true); // 是否顯示歷史記錄
const searchBox = ref(null); // 搜索框DOM引用// 模擬的搜索建議數據(實際應用中應替換為API請求)
const mockSuggestions = ["vue3教程","vue3中文文檔","vue3生命周期","vue3 composition api","vue3 vs vue2","vue3項目實戰","vue3組件開發","vue3響應式原理","vue3路由配置","vue3狀態管理"
];/*** 處理輸入事件 - 當用戶在搜索框中輸入時觸發*/
const handleInput = () => {// 如果搜索框為空,重置建議列表并顯示歷史記錄if (!query.value) {suggestions.value = [];showSuggestions.value = false;showHistory.value = true;return;}// 模擬API請求 - 實際應用中這里應該發送請求到后端setTimeout(() => {// 過濾出包含搜索關鍵詞的建議項(不區分大小寫)suggestions.value = mockSuggestions.filter(item => item.toLowerCase().includes(query.value.toLowerCase()));// 顯示建議列表showSuggestions.value = true;// 隱藏歷史記錄showHistory.value = false;// 重置激活建議項索引activeSuggestionIndex.value = -1;}, 200); // 200ms延遲模擬網絡請求
};/*** 清空輸入框內容*/
const clearInput = () => {query.value = '';suggestions.value = [];showSuggestions.value = false;showHistory.value = true;
};/*** 執行搜索操作*/
const search = () => {// 如果搜索內容為空則返回if (!query.value.trim()) return;// 添加到歷史記錄(避免重復)if (!searchHistory.value.includes(query.value)) {// 將新搜索詞添加到歷史記錄開頭searchHistory.value.unshift(query.value);// 最多保留10條歷史記錄if (searchHistory.value.length > 10) {searchHistory.value.pop();}// 將歷史記錄保存到localStoragelocalStorage.setItem('searchHistory', JSON.stringify(searchHistory.value));}// 在實際應用中這里應該執行真正的搜索操作// 這里使用alert模擬搜索結果alert(`搜索: ${query.value}`);// 隱藏建議列表showSuggestions.value = false;
};/*** 選擇搜索建議項* @param {string} suggestion - 選擇的建議項*/
const selectSuggestion = (suggestion) => {// 將建議項內容填充到搜索框query.value = suggestion;// 執行搜索search();
};/*** 選擇歷史記錄項* @param {string} item - 選擇的歷史記錄項*/
const selectHistory = (item) => {// 將歷史記錄內容填充到搜索框query.value = item;// 執行搜索search();
};/*** 清空歷史記錄*/
const clearHistory = () => {// 清空歷史記錄數組searchHistory.value = [];// 從localStorage中移除歷史記錄localStorage.removeItem('searchHistory');
};/*** 鍵盤向下箭頭事件處理* 用于在建議列表中向下導航*/
const onArrowDown = () => {if (activeSuggestionIndex.value < suggestions.value.length - 1) {activeSuggestionIndex.value++;}
};/*** 鍵盤向上箭頭事件處理* 用于在建議列表中向上導航*/
const onArrowUp = () => {if (activeSuggestionIndex.value > 0) {activeSuggestionIndex.value--;}
};/*** 鍵盤回車事件處理* 用于執行搜索或選擇當前建議項*/
const onEnter = () => {// 如果有激活的建議項,使用該建議項進行搜索if (activeSuggestionIndex.value >= 0 && suggestions.value.length > 0) {query.value = suggestions.value[activeSuggestionIndex.value];}// 執行搜索search();
};/*** 點擊外部區域關閉建議列表* @param {Event} event - 點擊事件對象*/
const handleClickOutside = (event) => {// 如果點擊發生在搜索框外部,則關閉建議列表if (searchBox.value && !searchBox.value.contains(event.target)) {showSuggestions.value = false;}
};/*** 組件掛載生命周期鉤子*/
onMounted(() => {// 從localStorage加載歷史記錄const savedHistory = localStorage.getItem('searchHistory');if (savedHistory) {searchHistory.value = JSON.parse(savedHistory);}// 添加全局點擊事件監聽器document.addEventListener('click', handleClickOutside);
});/*** 組件卸載生命周期鉤子*/
onUnmounted(() => {// 移除全局點擊事件監聽器document.removeEventListener('click', handleClickOutside);
});
</script><style scoped>
.logo-container {text-align: center;margin-bottom: 20px;width: 100%;padding-top: 40px;
}.logo {display: flex;justify-content: center;align-items: flex-end;margin-bottom: 8px;height: 48px;
}.logo-bai {font-family: Arial, sans-serif;color: #000;font-size: 48px;font-weight: 600;letter-spacing: -1px;line-height: 0.8;padding-right: 3px;position: relative;top: -2px;
}.logo-baidu {font-family: "PingFang SC", "Microsoft YaHei", sans-serif;color: #3385ff;font-size: 44px;font-weight: 700;line-height: 1;letter-spacing: -1px;
}.slogan {font-size: 16px;color: #666;margin-bottom: 15px;font-weight: 400;line-height: 1.5;
}.search-hint {font-size: 18px;color: #3385ff;font-weight: bold;letter-spacing: 1px;position: relative;
}.search-hint::after {content: "";position: absolute;bottom: -5px;left: 50%;transform: translateX(-50%);width: 85px;height: 3px;background: linear-gradient(90deg, transparent, #3385ff, transparent);border-radius: 2px;
}/* 搜索組件容器樣式 */
.search-container {display: flex;flex-direction: column;align-items: center;max-width: 800px;width: 100%;margin: 0 auto;padding: 20px;/* 漸變背景 */background: linear-gradient(180deg, #f1f1f1 0%, #f8f9fa 100px);min-height: 100vh;
}/* Logo容器樣式 */
.logo-container {margin-bottom: 30px;
}/* Logo文字樣式 */
.logo {font-size: 60px;font-weight: 700;letter-spacing: -4px;margin-bottom: 10px;/* 使用中文字體 */font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}/* 搜索框整體樣式 */
.search-box {display: flex;width: 100%;max-width: 600px;height: 50px;border: 2px solid #3385ff; /* 百度藍邊框 */border-radius: 10px;overflow: hidden;box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 輕微陰影 */background: white;
}/* 輸入框容器樣式 */
.search-input-container {flex: 1;position: relative;display: flex;align-items: center;
}/* 輸入框樣式 */
.search-input {width: 100%;height: 100%;padding: 0 20px;border: none;outline: none;font-size: 16px;color: #333;
}/* 清空按鈕樣式 */
.clear-btn {position: absolute;right: 15px;background: none;border: none;color: #999;cursor: pointer;font-size: 16px;transition: color 0.2s; /* 顏色過渡效果 */
}/* 清空按鈕懸停效果 */
.clear-btn:hover {color: #333;
}/* 搜索按鈕樣式 */
.search-btn {width: 100px;background: #3385ff; /* 百度藍 */color: white;border: none;font-size: 16px;cursor: pointer;transition: background 0.3s; /* 背景色過渡效果 */
}/* 搜索按鈕懸停效果 */
.search-btn:hover {background: #2a75e6; /* 深一點的藍色 */
}/* 建議列表和歷史記錄容器樣式 */
.suggestions, .history {width: 100%;max-width: 600px;margin-top: 5px;background: white;border-radius: 8px;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* 陰影效果 */overflow: hidden;
}/* 建議項和歷史項通用樣式 */
.suggestion-item, .history-item {padding: 12px 20px;display: flex;align-items: center;cursor: pointer;transition: background 0.2s; /* 背景色過渡效果 */
}/* 建議項懸停和激活狀態樣式 */
.suggestion-item:hover, .suggestion-item.active {background: #f5f7fa; /* 淺藍色背景 */
}/* 歷史項懸停效果 */
.history-item:hover {background: #f5f7fa;
}/* 圖標樣式 */
.suggestion-icon, .history-icon {margin-right: 15px;color: #999; /* 灰色圖標 */font-size: 14px;
}/* 歷史記錄頭部樣式 */
.history-header {display: flex;justify-content: space-between;align-items: center;padding: 12px 20px;border-bottom: 1px solid #eee; /* 底部邊框 */font-size: 14px;color: #666;
}/* 清空歷史按鈕樣式 */
.clear-history-btn {background: none;border: none;color: #3385ff; /* 百度藍 */cursor: pointer;font-size: 13px;display: flex;align-items: center;gap: 5px;
}/* 清空歷史按鈕懸停效果 */
.clear-history-btn:hover {text-decoration: underline; /* 下劃線效果 */
}.soutu-btn {float: left;width: 20px;height: 20px;background: #fff url(https://www.baidu.com/img/soutu.png) no-repeat;background-size: contain;margin-right: 10px;background-position: 0 -51px;right: 30px;z-index: 1;position: relative;
}.camera-icon {width: 20px;height: 16px;position: absolute;background: #333; /* 相機主體顏色 */border-radius: 3px; /* 圓角 */margin-left: -30px;/* 鏡頭部分 */&::before {content: "";position: absolute;width: 10px;height: 10px;background: #fff;border: 2px solid #333;border-radius: 50%;top: 50%;left: 50%;transform: translate(-50%, -50%);}/* 閃光燈部分 */&::after {content: "";position: absolute;width: 6px;height: 4px;background: #333;top: -3px;left: 50%;transform: translateX(-50%);border-radius: 2px 2px 0 0;box-shadow: 0 1px 0 rgba(255,255,255,0.1);}
}
</style>

typescript代碼如下:

<script setup lang="ts">
// Vue Composition API 引入
import { ref, onMounted, onUnmounted, type Ref } from 'vue';// 類型定義
type Suggestion = string;
type SearchHistory = string[];// 響應式數據定義
const query: Ref<string> = ref(''); // 搜索關鍵詞
const suggestions: Ref<Suggestion[]> = ref([]); // 搜索建議列表
const showSuggestions: Ref<boolean> = ref(false); // 是否顯示建議列表
const activeSuggestionIndex: Ref<number> = ref(-1); // 當前激活的建議項索引
const searchHistory: Ref<SearchHistory> = ref([]); // 搜索歷史記錄
const showHistory: Ref<boolean> = ref(true); // 是否顯示歷史記錄
const searchBox: Ref<HTMLElement | null> = ref(null); // 搜索框DOM引用// 模擬的搜索建議數據
const mockSuggestions: Suggestion[] = ["vue3教程","vue3中文文檔","vue3生命周期","vue3 composition api","vue3 vs vue2","vue3項目實戰","vue3組件開發","vue3響應式原理","vue3路由配置","vue3狀態管理"
];/*** 處理輸入事件 - 當用戶在搜索框中輸入時觸發*/
const handleInput = (): void => {// 如果搜索框為空,重置建議列表并顯示歷史記錄if (!query.value) {suggestions
.value = [];showSuggestions
.value = false;showHistory
.value = true;return;}// 模擬API請求setTimeout(() => {// 過濾出包含搜索關鍵詞的建議項(不區分大小寫)suggestions
.value = mockSuggestions.filter(item => item
.toLowerCase().includes(query.value.toLowerCase()));// 顯示建議列表showSuggestions.value = true;// 隱藏歷史記錄showHistory.value = false;// 重置激活建議項索引activeSuggestionIndex.value = -1;}, 200); // 200ms延遲模擬網絡請求
};/*** 清空輸入框內容*/
const clearInput = (): void => {query.value = '';suggestions.value = [];showSuggestions.value = false;showHistory.value = true;
};/*** 執行搜索操作*/
const search = (): void => {// 如果搜索內容為空則返回if (!query.value.trim()) return;// 添加到歷史記錄(避免重復)if (!searchHistory.value.includes(query.value)) {// 將新搜索詞添加到歷史記錄開頭searchHistory.value.unshift(query.value);// 最多保留10條歷史記錄if (searchHistory.value.length > 10) {searchHistory.value.pop();}// 將歷史記錄保存到localStoragelocalStorage.setItem('searchHistory', JSON.stringify(searchHistory.value));}// 在實際應用中這里應該執行真正的搜索操作// 這里使用alert模擬搜索結果alert(`搜索: ${query.value}`);// 隱藏建議列表showSuggestions.value = false;
};/*** 選擇搜索建議項* @param suggestion - 選擇的建議項*/
const selectSuggestion = (suggestion: Suggestion): void => {// 將建議項內容填充到搜索框query.value = suggestion;// 執行搜索search();
};/*** 選擇歷史記錄項* @param item - 選擇的歷史記錄項*/
const selectHistory = (item: string): void => {// 將歷史記錄內容填充到搜索框query.value = item;// 執行搜索search();
};/*** 清空歷史記錄*/
const clearHistory = (): void => {// 清空歷史記錄數組searchHistory.value = [];// 從localStorage中移除歷史記錄localStorage
.removeItem('searchHistory');
};/*** 鍵盤向下箭頭事件處理* 用于在建議列表中向下導航*/
const onArrowDown = (e: Event): void => {e
.preventDefault(); // 阻止默認行為if (activeSuggestionIndex.value < suggestions.value.length - 1) {activeSuggestionIndex.value++;}
};/*** 鍵盤向上箭頭事件處理* 用于在建議列表中向上導航*/
const onArrowUp = (e: Event): void => {e
.preventDefault(); // 阻止默認行為if (activeSuggestionIndex.value > 0) {activeSuggestionIndex.value--;}
};/*** 鍵盤回車事件處理* 用于執行搜索或選擇當前建議項*/
const onEnter = (): void => {// 如果有激活的建議項,使用該建議項進行搜索if (activeSuggestionIndex.value >= 0 && suggestions.value.length > 0) {query.value = suggestions.value[activeSuggestionIndex.value];}// 執行搜索search();
};/*** 點擊外部區域關閉建議列表* @param event - 點擊事件對象*/
const handleClickOutside = (event: MouseEvent): void => {// 如果點擊發生在搜索框外部,則關閉建議列表if (searchBox.value && !searchBox.value.contains(event.target as Node)) {showSuggestions.value = false;}
};/*** 組件掛載生命周期鉤子*/
onMounted((): void => {// 從localStorage加載歷史記錄const savedHistory: string | null = localStorage.getItem('searchHistory');if (savedHistory) {try {searchHistory.value = JSON.parse(savedHistory) as SearchHistory;} catch (error) {console
.error('Failed to parse search history:', error);// 清空無效歷史記錄localStorage.removeItem('searchHistory');searchHistory.value = [];}}// 添加全局點擊事件監聽器document.addEventListener('click', handleClickOutside);
});/*** 組件卸載生命周期鉤子*/
onUnmounted((): void => {// 移除全局點擊事件監聽器document.removeEventListener('click', handleClickOutside);
});
</script>

若父組件使用script setup的形式,自動暴露了頂層變量,則無需在父組件中使用components聲明引用子組件。
運行如圖所示:
在這里插入圖片描述

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

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

相關文章

智凈未來:華為智選IAM以科技巧思優化家庭健康飲水體驗

在中國家庭中&#xff0c;凈水器早已成為廚房標配&#xff0c;但傳統凈水設備的使用體驗卻遠未達到理想狀態。根據《2023年中國家庭凈水器使用調研報告》顯示&#xff0c;超過65%的用戶對傳統凈水器存在不滿&#xff0c;主要痛點集中在功能單一、操作復雜、維護麻煩、噪音大、廢…

細說STM32單片機SPI-Flash芯片的FatFS移植

目錄 一、SPI-Flash芯片硬件電路 二、CubeMX項目基礎設置 1、RCC、SYS、Code Generator、USART6、NVIC 2、RTC 3、SPI2 4、GPIO 5、FatFS模式 6、FatFS參數設置概述 &#xff08;1&#xff09;Version組 &#xff08;2&#xff09;Function Parameters組 1&#x…

ubuntu 22.04 安裝部署logstash 7.10.0詳細教程

安裝部署logstash 7.10.0詳細教程 一、下載并安裝二、新建配置文件三、賦權文件權限四、檢測文件grok語法是否異常五、啟動服務六、安裝啟動常見問題 【背景】 整個elk安裝是基于ubuntu 22.04和jdk 11環境。logstash采用 *.deb方式安裝&#xff0c;需要服務器能聯網。ubuntu 22…

JVM對象創建與內存分配機制深度剖析

對象創建的主要流程 類加載檢查 在創建對象之前&#xff0c;JVM 首先會檢查該類是否已經加載、解析并初始化&#xff1a; 如果沒有&#xff0c;則會通過類加載機制加載類元信息&#xff08;Class Metadata&#xff09;到方法區。 這個過程包括&#xff1a;加載&#xff08;load…

Navicat 技術指引 | TiDB 的 AI 查詢交互功能

目前&#xff0c;Navicat 兩款工具支持對 TiDB 數據庫的管理開發功能&#xff1a;一款是旗艦款 Navicat Premium&#xff0c;另一款是其輕量化功能的 Navicat Premium Lite&#xff08;官方輕量級免費版&#xff09;。Navicat 自版本 17.1 開始支持 TiDB 7。它支持的系統有 Win…

以list為輸入條件,查詢數據庫表,java中的mapper層和mybatis層應該怎么寫?

根據一個 List 中的兩個字段 rangeCode 和 unitcd&#xff0c;查詢數據庫表 model_engineering_spatial_unit。這個需求在 Java MyBatis 項目中非常常見&#xff0c;下面我將為你詳細寫出 Mapper 接口&#xff08;Java&#xff09; 和 MyBatis XML 映射文件 的寫法。 ? 前提…

pyspark 創建DataFrame

from pyspark.sql import SparkSession from pyspark.sql import StructType, StructField, IntegerType,StringType spark SparkSession.builder.appName(test).getOrCreate() 1、 從列表中創建DataFrame data [(1,"alice"),(2,Blob),(3,Charlie)] columns [&qu…

Vim:從入門到進階的高效文本編輯器之旅

目錄 一、Vim簡介 二、Vim的基礎操作 2.1 進入和退出Vim 2.2 Vim的三種模式 2.3 基礎移動 三、Vim的高效編輯技巧 3.1 文本編輯 3.2 文本刪除與修改 3.3 復制與粘貼 四、Vim的進階使用 4.1 搜索與替換 4.2 寄存器與宏 4.3 插件與配置 五、結語 在編程界&#xff0…

Docker基礎理論與阿里云Linux服務器安裝指南

文章目錄 一、Docker核心概念二、阿里云環境準備三、Docker安裝與配置四、核心容器部署示例五、開發環境容器化六、運維管理技巧七、安全加固措施 一、Docker核心概念 容器化本質&#xff1a; 輕量級虛擬化技術&#xff0c;共享主機內核進程級隔離&#xff08;cgroups/namespac…

c#使用筆記之try catch和throw

一、try catch 一種報錯的捕捉機制&#xff0c;try塊里運行的代碼出現錯誤的時候就會去執行catch塊所以一般catch塊里都是把錯誤打印出來或者保存到log日志里&#xff1b; 1.1、具體使用 catch可以用&#xff08;&#xff09;來選擇捕捉什么類型的錯誤&#xff0c;一般用Exc…

(新手友好)MySQL學習筆記(9):索引(常見索引類型,查找結構的發展(二分查找法,二叉搜索樹,平衡二叉樹,B樹,B+樹))

目錄 索引 常見索引類型 B樹 二分查找法 二叉搜索樹和平衡二叉樹 B樹和B樹 索引 index&#xff0c;是存儲引擎用于快速找到數據的一種數據結構。 MySQL默認使用InnoDB存儲引擎&#xff0c;該存儲引擎是最重要&#xff0c;使用最廣泛的&#xff0c;除非有非常特別的原因需要使用…

進程間通信1(匿名管道)Linux

1 進程間通信的必要性 首先要明確進程間是相互獨立的&#xff08;獨享一份虛擬地址空間&#xff0c;頁表&#xff0c;資源&#xff09;&#xff0c;那怎么樣才能使得兩個進程間實現資源的發送&#xff1f;所以&#xff0c;兩個進程一定需要看到同一份資源&#xff0c;并且?個…

CAN2.0、DoIP、CAN-FD汽車協議詳解與應用

一、CAN2.0 協議詳解與應用示例 1. 技術原理與特性 協議架構&#xff1a;基于 ISO 11898 標準&#xff0c;采用載波監聽多路訪問 / 沖突檢測&#xff08;CSMA/CD&#xff09;機制&#xff0c;支持 11 位&#xff08;CAN2.0A&#xff09;或 29 位&#xff08;CAN2.0B&#xff…

使用nvm管理npm和pnpm

1.使用nvm管理npm // 查看nvm版本 nvm -v // 查看可安裝的 node 版本 nvm ls-remote // 安裝指定 node 版本 nvm install 24.0.0 // 查看當前已安裝的 node 版本及當前使用的版本 nvm list // 使用某個版本 node nvm use 24.0.0 // 卸載指定 node 版本 nvm uninstall 16.20.1…

YOLO11+QT6+Opencv+C++訓練加載模型全過程講解

實現效果&#xff1a; Yolov11環境搭建&#xff08;搭建好的可以直接跳過&#xff09; 最好使用Anconda進行包管理&#xff0c;安裝可參考【文章】。下面簡單過一下如何快速部署環境。如果搭建過或可以參考其他文章可以跳過Yolo11環境搭建這一章節。總體來說Yolov11環境搭建越…

Python 腳本,用于將 PDF 文件高質量地轉換為 PNG 圖像

import os import fitz # PyMuPDF from PIL import Image import argparse import logging from tqdm import tqdm# 配置日志 logging.basicConfig(levellogging.INFO, format%(asctime)s - %(levelname)s - %(message)s) logger logging.getLogger(PDF2PNG)def convert_pdf_…

【CUDA GPU 支持安裝全攻略】PyTorch 深度學習開發者指南

PyTorch 的 CUDA GPU 支持 安裝五條鐵律&#xff08;最新版 2025 修訂&#xff09;&#xff08;適用于所有用戶&#xff09;-CSDN博客 是否需要預先安裝 CUDA Toolkit&#xff1f;——按使用場景分級推薦及進階說明-CSDN博客 “100% 成功的 PyTorch CUDA GPU 支持” 安裝攻略…

Cyberith 運動模擬器Virtualizer2:提升虛擬現實沉浸體驗

奧地利Cyberith公司是一家專注于虛擬現實&#xff08;VR&#xff09;互動解決方案的創新型科技企業&#xff0c;以其研發的Virtualizer虛擬現實步態模擬設備而聞名。該公司的核心技術體現在其設計和制造的全方位跑步機式VR交互平臺上&#xff0c;使得用戶能夠在虛擬環境中實現自…

常見的數據處理方法有哪些?ETL中的數據處理怎么完成

在數字化轉型縱深推進的背景下&#xff0c;數據作為新型生產要素已成為驅動企業戰略決策、科研創新及智能化運營的核心戰略資產。數據治理價值鏈中的處理環節作為關鍵價值節點&#xff0c;其本質是通過系統化處理流程將原始觀測數據轉化為結構化知識產物&#xff0c;以支撐預測…

WHAT - 為甲方做一個官網(二)- 快速版

文章目錄 一、明確需求優先級&#xff08;快速決策&#xff09;二、推薦零代碼/低代碼工具&#xff08;附對比&#xff09;方案1&#xff1a;低代碼建站平臺&#xff08;適合無技術用戶&#xff0c;拖拽式操作&#xff09;方案2&#xff1a;CMS系統&#xff08;適合內容更新頻繁…