Vue?? ? ?? ???? ???? ????? ?? ?? ??? ?????.
Vue? ???? ??? ? ??????? ? ?? ???? Excel? ????? Excel ??? ???? ?? ??? ?? ????. ? ????? Vue? ???? ??? ???? ???? ? ???? ??? ???? ??? ???? ???? ?? ??? ?????.
1. ??? ??? ????
- ?? ???
?? Excel ??? ???? ?? ? ?? ???? ???? ???. Vue ????? ????? ?? ??? ?????.
npm install file-saver xlsx --save
- ???? ?? ???
Vue ?? ???? ???? ??? ????? ???? ??? ???? ???. ???? ?? ??? ???? ?? ???? ???? ??? ???? ? ????. ?? ??? ????.
<template> <div> <button @click="exportData">導(dǎo)出表格數(shù)據(jù)</button> ... </div> </template>
- ???? ?? ??
Vue ?? ??? methods
?? , ???? ??? ?????. ? ??? ????? ???? ??? ???? Excel ??? ???? ?????. ???? ??? ??? ????. methods
中,定義一個導(dǎo)出方法。該方法將從表格中獲取數(shù)據(jù),并將數(shù)據(jù)轉(zhuǎn)換為Excel文件并導(dǎo)出。具體的代碼如下:
import { saveAs } from 'file-saver' import XLSX from 'xlsx' export default { methods: { exportData() { // 從表格中獲取數(shù)據(jù),假設(shè)數(shù)據(jù)存儲在一個名為tableData的數(shù)組中 const data = this.tableData // 創(chuàng)建一個工作簿對象 const workbook = XLSX.utils.book_new() // 創(chuàng)建一個工作表對象 const worksheet = XLSX.utils.json_to_sheet(data) // 將工作表添加到工作簿 XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1') // 將工作簿轉(zhuǎn)換為二進(jìn)制數(shù)據(jù) const excelData = XLSX.write(workbook, { type: 'array' }) // 將二進(jìn)制數(shù)據(jù)轉(zhuǎn)換為Blob對象 const blob = new Blob([excelData], { type: 'application/octet-stream' }) // 使用FileSaver.js保存文件 saveAs(blob, 'table_data.xlsx') } } }
- 完成導(dǎo)出功能
至此,我們已經(jīng)完成了表格數(shù)據(jù)的導(dǎo)出功能。當(dāng)用戶點擊導(dǎo)出按鈕時,將會觸發(fā)exportData
方法,從表格中獲取數(shù)據(jù),并轉(zhuǎn)換為Excel文件并導(dǎo)出。
二、表格數(shù)據(jù)的導(dǎo)入
- 創(chuàng)建導(dǎo)入按鈕
首先,我們需要在Vue組件中創(chuàng)建一個導(dǎo)入按鈕,用于觸發(fā)導(dǎo)入操作??梢栽谀0逯刑砑右粋€按鈕元素,并綁定點擊事件到一個導(dǎo)入方法,示例如下:
<template> <div> <input type="file" ref="fileInput" style="display: none" @change="importData"> <button @click="openFileInput">導(dǎo)入表格數(shù)據(jù)</button> ... </div> </template>
- 實現(xiàn)文件輸入的交互
在Vue組件的methods
中,實現(xiàn)打開文件輸入框的交互。具體代碼如下:
export default { methods: { openFileInput() { // 觸發(fā)input元素的點擊事件 this.$refs.fileInput.click() }, importData() { const file = this.$refs.fileInput.files[0] // 使用FileReader讀取文件內(nèi)容 const reader = new FileReader() reader.onload = (e) => { const data = new Uint8Array(e.target.result) const workbook = XLSX.read(data, { type: 'array' }) const worksheet = workbook.Sheets[workbook.SheetNames[0]] const jsonData = XLSX.utils.sheet_to_json(worksheet, { header: 1 }) // 處理導(dǎo)入的數(shù)據(jù) // ... } reader.readAsArrayBuffer(file) } } }
- 處理導(dǎo)入的數(shù)據(jù)
在importData
方法中,我們使用FileReader
讀取導(dǎo)入的Excel文件,并將文件內(nèi)容解析為JSON對象。接下來,我們可以處理導(dǎo)入的數(shù)據(jù),例如將其存儲到Vue數(shù)據(jù)對象中,或者對數(shù)據(jù)進(jìn)行其他操作。
至此,我們已經(jīng)完成了表格數(shù)據(jù)的導(dǎo)入功能。當(dāng)用戶點擊導(dǎo)入按鈕時,將會觸發(fā)importData
rrreee
- ???? ?? ?????? ??? ??? ???? ??? ???????. ???? ???? ??? ????
exportData
???? ????? ????? ???? ??? Excel ??? ???? ?????. ????2. ??? ??? ?????????????? ?? ??????????? ???? ??? ????? Vue ?? ??? ???? ??? ???? ???. ???? ?? ??? ???? ?? ???? ???? ???? ???? ? ????. ?? ??? ????. ??rrreee?????? ??? ?? ??? ???????? Vue ?? ??? ?? ?? ?? ?? ?? ??? ?????. ???? ??? ??? ????. ??rrreee??????? ??? ????????importData
?????? FileReader
? ???? ??? Excel ??? ?? ?? ??? ?? ?????. JSON ???. ???? ??? ???? Vue ??? ??? ????? ???? ?? ?? ??? ???? ? ??? ? ????. ?????? ??? ??? ???? ??? ???????. ???? ???? ??? ???? importData
???? ??????. ?? ?? ??? ?? Excel ??? ??? ? ?? ??? ?? JSON ??? ?? ???? ?????. ???? ??. ?????????, ? ???? Vue? ???? ??? ???? ???? ? ???? ??? ???? ??? ???? ???? ?? ??? ?????. ??? ?? ??? ?? Vue ?????? ??? ???? Excel ??? ???? Excel ??? ???? ???? ??? ?? ??? ? ????. ??? ??? ??? ? ?? ???? ?? ???? ?? ???? ????? ? ??? ? ? ????. ??? ??? Vue?? ??? ???? ???? ???? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

1. ???? ? PPT ??? ??? ??? [PPT Tips]? ?????. 2. [PPT ?]? ?????? PPT ??? ???. 3. ?? ?? ? 2?? ? 2?? ??? ?? ?????. 4. ??? ???? ?????? ?? ??? [???] ??? ?????. 5. [??] ??? ??? ? [??]? ?????. 6. [??]? ???? ??? ???? ??? ?? ?? ??? ?????. 7. ?????? ????? ???? ?? ? ??? ???? ??? ?????. 8. ??? ??? ??? ??? ???? ???? ?? ?? ??? ?????. 9. [? ??]? ???? [???? ???? ??]? ?????. 10. [??], [??] ? ?? ??? ??? ??? ? ??? ?????. ??: ???? ???? ??? ??? ????.

DDREASE? ?? ????, SSD, RAM ???, CD, DVD ? USB ?? ??? ?? ?? ?? ?? ???? ???? ???? ?? ?????. ? ?? ???? ?? ?? ??? ???? ???? ??? ??? ??? ???? ??? ??? ??? ?????. ddreasue? ?? ?? ?? ??? ???? ???? ??? ???? ??? ?? ?????. ??? ddasue ? ?? ??? ???? ???? ?? ??? ? ????. DDREASE? ?? ?? ??? ??? ????. ??? ???? ???? ??? ?? ?? ? ??? ????. ??? ??? ????? ??? ???? ?? ? ????. ?? ???? ??? ???? ?? ??? ??

0. ? ?? ?? ??? ?? ???? ??? ?????? ?? ??? ?? ?? ?? ?? ??? DepthFM? ?????. DepthFM? ???? ?? ?? ?? ??? ?? ????? ?? ????? ???? ??? ??? ?????. DepthFM? ????? ? ?? ?? ?? ??? ?? ?? ??? ? ????. ? ??? ?? ?????~ 1. ?? ?? ??: DepthFM: FastMoncularDepthEstimationwithFlowMatching ??: MingGui, JohannesS.Fischer, UlrichPrestel, PingchuanMa, Dmytr

1. ????? ?? [??]-[??? ??] ??? ????. 2. ? ??? ???? ??? ??? ??? ?? ?????. 3. [??? ??] ??? ???? ?? ??? ?????. 4. [????? ??]-[??]? ?????. 5. 20, 24, ?? ?? ???? ??? ??? ?? ??? ?????. 6. ?? ?, ??? ?? ???? ??? ?? ?? ??, ??? ? ? ??? ??? ?????. 7. ???? ?? ??? ??? ????? ??? ? ???, ???? ??? ?? WPS? ??? ??? ??? ??? ???? ??? ???? ?????. 8. [??] ?? 20-24 ? [?? ??] 20 ?? ? ?? ????? ?????. 9. ??? ???? ?? ?? ??? ??? ?? ??? ????? ???.

??? ???? iPhone? ??? ??? ?? ??? ????? ????? ???? ??? ??? ??? ??, ??? ???? ??, ?? ?? ?? ?? ?? ??? ?? ?????. ? ??? ???? ??? ??? ??? ?? ?? ? ? ?? ?? ? ?? ????. ?? 1 – iPhone ?? ?? ?? ??? ??? ??? ?? ???? ??? ??? ??? ?? ??? ??????. 1?? – ?? ??? ?? ? ? ???? ????. ?? ?? ?? ?? ?? ???? ?? ????. 2?? - ????? ?? ??? ???? ?? ??? ??? ????. iPhone? ?? ????? ???. ??? ???? ????? ???? ??? ?????. ?? ????? ?? 2 – ??? ?? ?? 5G? ? ?? ???? ??? ????? ??? ?? ? ? ? ?????

???? ??? ??? ? ??? ?? ??, ??, ??? ??? ??? ?? ??? ?? ??????? ?? ?????. ???? ??? ??? ???? ?? ?? ????, ??? ???? ?? ??? ??? ??? ?? ?? ?????. ? ?? ?????? ??? ???? ???? ???? ?? ? ??? ???? ????? ?? ??? ??? ??? ?????. 1. [?? ?? ? ?? ??], xlsm? ?? ? ???? ??? ???? ?????. 2. ??? [? ????]? ???? [?]? ??? ? [?? ??]? ?????. ??? [???]?? ?? [????]. [??] ???? ??? ? [

Google? ???? JAX? ??? ?? ???? ????? Pytorch? TensorFlow? ???? 7? ???? 1?? ??????. ??? JAX ??? ?? ?? TPU??? ???? ????? ?????. ???? ????? ??? Tensorflow?? Pytorch? ? ??? ????. ??? ???? ? ? ??? JAX ???? ???? ???? ??? ????. ?? ?? Keras ?? ?? PyTorch ??? ???? ? ?? ???(TensorFlow, JAX, PyTorch)? TensorFlow? ???? Keras2? ????????. ??, ??? ?? ??? ?????.

???? ?? ????(Optimus)? ?? ??? ?????, ?? ???? ??? ??? ???. ?? ????? ???(???? 4680 ???)? ??? ?? ?????. ??? ?? 20? ??? ??? ??? ??????. ?? "??????"?? ?? ?? ?? : ??? ?????. ???? ????? ???? ? ??? ? ??? ?? ??? ?? ?? ??? ????? ???? ??? ?? ????. ??? Optimus? ???? ?? ?? ?? ??? ??? ?? ???? ???? ?? ?? ?? ????. NVIDIA ??? Jim Fan? Optimus? ?? ?? ?? ??? ????. Optimus? ?? ??? ?? ??? ?? ? ?????. ?? ?????. ?? ???? ?? ???
