Vue3實(shí)現(xiàn)pdf預(yù)覽功能
1.使用到的插件 vue3-pdf-app 以及預(yù)覽效果

2.下載依賴
// 可以使用npm 以及pnpm // 下載版本1.0.3 pnpm install vue3-pdf-app@^1.0.3
3.封裝pdfModel組件復(fù)用
<template>
<VuePdfApp :page-scale="pageScale" :theme="theme" :style="`width: ${viewerWidth}; height: ${viewerHeight};`"
:pdf="src" :fileName="fileName" @pages-rendered="pagesRendered" v-bind="$attrs" :config="config"></VuePdfApp>
</template>
<script setup lang="ts">
import { computed, ref } from 'vue'
import VuePdfApp from 'vue3-pdf-app'
import 'vue3-pdf-app/dist/icons/main.css'
// 工具欄配置項(xiàng)
const config = ref({
// 右側(cè)其他區(qū)工具
sidebar: {
viewThumbnail: true,//啟用縮略圖視圖
viewOutline: true,//啟用大綱視圖
viewAttachments: false,//啟用附件視圖
},
secondaryToolbar: {
secondaryPresentationMode: true,//啟用演示模式
secondaryOpenFile: true, //啟用打開(kāi)文件功能
secondaryPrint: true,//啟用打印功能
secondaryDownload: true,//啟用下載功能
secondaryViewBookmark: true,//啟用書(shū)簽視圖
firstPage: false,//啟用跳轉(zhuǎn)到第一頁(yè)
lastPage: false,//啟用跳轉(zhuǎn)到最后一頁(yè)
pageRotateCw: true,//啟用順時(shí)針旋轉(zhuǎn)頁(yè)面
pageRotateCcw: true,//啟用逆時(shí)針旋轉(zhuǎn)頁(yè)面
cursorSelectTool: false,//啟用選擇工具
cursorHandTool: false,//啟用手形工具
scrollVertical: false,//啟用垂直滾動(dòng)
scrollHorizontal: false,//啟用水平滾動(dòng)
scrollWrapped: false,//啟用包裹滾動(dòng)
spreadNone: false,//啟用無(wú)跨頁(yè)模式
spreadOdd: false,// 啟用奇數(shù)頁(yè)跨頁(yè)模式
spreadEven: false,//啟用偶數(shù)頁(yè)跨頁(yè)模式
documentProperties: false,//啟用文檔屬性查看
},
// 配置左側(cè)工具欄
toolbar: {
toolbarViewerLeft: {
findbar: false,//啟用查找條
previous: true,// 啟用上一頁(yè)按鈕
next: true,//啟用下一頁(yè)按鈕
pageNumber: true,// 啟用頁(yè)碼顯示
},
// 配置右側(cè)工具欄
toolbarViewerRight: {
presentationMode: false,//啟用演示模式
openFile: false,//啟用打開(kāi)文件功能
print: false,//啟用打印功能
download: false,// 啟用下載功能
viewBookmark: false,// 啟用書(shū)簽視圖
},
// 配置中間工具欄
toolbarViewerMiddle: {
zoomOut: true,// 啟用縮小功能
zoomIn: true,//啟用放大功能。
scaleSelectContainer: false,//啟用縮放選擇容器功能
},
},
//啟用錯(cuò)誤包裝,這可能用于顯示錯(cuò)誤信息或處理錯(cuò)誤情況。
errorWrapper: true,
})
interface Props {
src: string | ArrayBuffer // pdf地址
width?: string | number // 預(yù)覽容器寬度
height?: string | number // 預(yù)覽容器高度
pageScale?: number | string // 頁(yè)面默認(rèn)縮放規(guī)則,可選 'page-actual'|'page-width'|'page-height'|'page-fit'|'auto'
theme?: string // 預(yù)覽主題 可選 dark | light
fileName?: string // 覆蓋pdf文件名
}
const props = withDefaults(defineProps<Props>(), {
src: '',
width: '100%',
height: '100%',
pageScale: 'page-fit', // 默認(rèn)自適應(yīng)展示一頁(yè)
theme: 'dark',
fileName: ''
})
const viewerWidth = computed(() => {
if (typeof props.width === 'number') {
return props.width + 'px'
} else {
return props.width
}
})
const viewerHeight = computed(() => {
if (typeof props.height === 'number') {
return props.height + 'px'
} else {
return props.height
}
})
const emit = defineEmits(['loaded'])
function pagesRendered(pdfApp: any) {
// console.log('pdfApp頁(yè)碼渲染完成:', pdfApp)
emit('loaded', pdfApp)
}
</script>
<style lang="less" scoped>
@themeColor: #1677FF;
:deep(*) {
box-sizing: content-box;
}
// 定制化主題色
.pdf-app.dark {
--pdf-app-background-color: rgb(83, 86, 89, 0);
--pdf-sidebar-content-color: rgb(51, 54, 57);
--pdf-toolbar-sidebar-color: #24364e;
--pdf-toolbar-color: rgb(50, 54, 57);
--pdf-loading-bar-color: #606c88;
--pdf-loading-bar-secondary-color: @themeColor;
--pdf-find-results-count-color: #d9d9d9;
--pdf-find-results-count-font-color: #525252;
--pdf-find-message-font-color: #a6b7d0;
--pdf-not-found-color: #f66;
--pdf-split-toolbar-button-separator-color: #fff;
--pdf-toolbar-font-color: #d9d9d9;
--pdf-button-hover-font-color: @themeColor;
--pdf-button-toggled-color: #606c88;
--pdf-horizontal-toolbar-separator-color: #fff;
--pdf-input-color: #606c88;
--pdf-input-font-color: #d9d9d9;
--pdf-find-input-placeholder-font-color: @themeColor;
--pdf-thumbnail-selection-ring-color: hsla(0, 0%, 100%, .15);
--pdf-thumbnail-selection-ring-selected-color: rgb(147, 179, 242);
--pdf-error-wrapper-color: #f55;
--pdf-error-more-info-color: #d9d9d9;
--pdf-error-more-info-font-color: #000;
--pdf-overlay-container-color: rgba(0, 0, 0, .2);
--pdf-overlay-container-dialog-color: #24364e;
--pdf-overlay-container-dialog-font-color: #d9d9d9;
--pdf-overlay-container-dialog-separator-color: #fff;
--pdf-dialog-button-font-color: #d9d9d9;
--pdf-dialog-button-color: #606c88;
:deep(.thumbnail.selected>.thumbnailSelectionRing) {
background-color: rgb(147, 179, 242);
}
}
.pdf-app.light {
--pdf-app-background-color: rgb(245, 245, 245);
--pdf-sidebar-content-color: rgb(245, 245, 245);
--pdf-toolbar-sidebar-color: rgb(190, 190, 190);
--pdf-toolbar-color: rgb(225, 225, 225);
--pdf-loading-bar-color: #3f4b5b;
--pdf-loading-bar-secondary-color: #666;
--pdf-find-results-count-color: #3f4b5b;
--pdf-find-results-count-font-color: hsla(0, 0%, 100%, .87);
--pdf-find-message-font-color: hsla(0, 0%, 100%, .87);
--pdf-not-found-color: brown;
--pdf-split-toolbar-button-separator-color: #000;
--pdf-toolbar-font-color: rgb(142, 142, 142);
--pdf-button-hover-font-color: #666;
--pdf-button-toggled-color: #3f4b5b;
--pdf-horizontal-toolbar-separator-color: #000;
--pdf-input-color: #3f4b5b;
--pdf-input-font-color: #d9d9d9;
--pdf-find-input-placeholder-font-color: #666;
--pdf-thumbnail-selection-ring-color: hsla(208, 7%, 46%, .7);
--pdf-thumbnail-selection-ring-selected-color: #3f4b5b;
--pdf-error-wrapper-color: #f55;
--pdf-error-more-info-color: #d9d9d9;
--pdf-error-more-info-font-color: #000;
--pdf-overlay-container-color: hsla(208, 7%, 46%, .7);
--pdf-overlay-container-dialog-color: #6c757d;
--pdf-overlay-container-dialog-font-color: #d9d9d9;
--pdf-overlay-container-dialog-separator-color: #000;
--pdf-dialog-button-font-color: #d9d9d9;
--pdf-dialog-button-color: #3f4b5b;
:deep(.thumbnail.selected>.thumbnailSelectionRing) {
background-color: rgb(105, 105, 105);
}
}
</style>4.頁(yè)面使用(可以直接使用在線pdf鏈接 也可以上傳pdf預(yù)覽)
<template>
<div style="margin: 20px;">
<input type="file" @change="handleChange" />
</div>
<div class="pdfBox" v-if="pdfUrl !== ''">
<PdfPreview page-scale="page-fit" :width="900" :height="600" theme="light" :src="pdfUrl" @loaded="onLoaded" />
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import PdfPreview from './pdfModel.vue';
// const pdfUrl = ref<any>('http://storage.xuetangx.com/public_assets/xuetangx/PDF/PlayerAPI_v1.0.6.pdf');
const pdfUrl = ref<any>('');
// 判斷文件加載完成
const onLoaded = (pdfApp: any) => {
console.log('文件加載完成');
};
// 也可直接上傳文件顯示
let handleChange = (e: any) => {
let files = e.target.files[0];
let reader = new FileReader();
reader.readAsArrayBuffer(files);
reader.onload = function () {
// docxSrc.value = reader.result;
pdfUrl.value = reader.result;
};
};
</script>
<style scoped lang="less">
.pdfBox {
width: 900px;
height: 600px;
overflow: scroll;
overflow-x: hidden;
overflow-y: hidden;
}
</style>5.設(shè)置中文
能看到在使用的時(shí)候操作欄全部都是英文

6.創(chuàng)建 viewer.properties文件與src同級(jí)

文件代碼
# vue3-pdf-app插件轉(zhuǎn)中文配置代碼
# Copyright 2012 Mozilla Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Main toolbar buttons (tooltips and alt text for images)
previous.title=上一頁(yè)
previous_label=上一頁(yè)
next.title=下一頁(yè)
next_label=下一頁(yè)
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
page.title=頁(yè)面
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
# representing the total number of pages in the document.
of_pages=/ {{pagesCount}}
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
# will be replaced by a number representing the currently visible page,
# respectively a number representing the total number of pages in the document.
page_of_pages=({{pageNumber}} / {{pagesCount}})
zoom_out.title=縮小
zoom_out_label=縮小
zoom_in.title=放大
zoom_in_label=放大
zoom.title=縮放
presentation_mode.title=切換到演示模式
presentation_mode_label=演示模式
open_file.title=打開(kāi)文件
open_file_label=打開(kāi)
print.title=打印
print_label=打印
download.title=下載
download_label=下載
bookmark.title=當(dāng)前在看的內(nèi)容(復(fù)制或在新窗口中打開(kāi))
bookmark_label=當(dāng)前在看
save.title=保存
save_label=保存
bookmark1.title=當(dāng)前頁(yè)面(在當(dāng)前頁(yè)面查看 URL)
bookmark1_label=當(dāng)前頁(yè)面
# Secondary toolbar and context menu
tools.title=工具
tools_label=工具
first_page.title=轉(zhuǎn)到第一頁(yè)
first_page_label=轉(zhuǎn)到第一頁(yè)
last_page.title=轉(zhuǎn)到最后一頁(yè)
last_page_label=轉(zhuǎn)到最后一頁(yè)
page_rotate_cw.title=順時(shí)針旋轉(zhuǎn)
page_rotate_cw_label=順時(shí)針旋轉(zhuǎn)
page_rotate_ccw.title=逆時(shí)針旋轉(zhuǎn)
page_rotate_ccw_label=逆時(shí)針旋轉(zhuǎn)
cursor_text_select_tool.title=啟用文本選擇工具
cursor_text_select_tool_label=文本選擇工具
cursor_hand_tool.title=啟用手形工具
cursor_hand_tool_label=手形工具
scroll_page.title=使用頁(yè)面滾動(dòng)
scroll_page_label=頁(yè)面滾動(dòng)
scroll_vertical.title=使用垂直滾動(dòng)
scroll_vertical_label=垂直滾動(dòng)
scroll_horizontal.title=使用水平滾動(dòng)
scroll_horizontal_label=水平滾動(dòng)
scroll_wrapped.title=使用平鋪滾動(dòng)
scroll_wrapped_label=平鋪滾動(dòng)
spread_none.title=不加入銜接頁(yè)
spread_none_label=單頁(yè)視圖
spread_odd.title=加入銜接頁(yè)使奇數(shù)頁(yè)作為起始頁(yè)
spread_odd_label=雙頁(yè)視圖
spread_even.title=加入銜接頁(yè)使偶數(shù)頁(yè)作為起始頁(yè)
spread_even_label=書(shū)籍視圖
# Document properties dialog box
document_properties.title=文檔屬性…
document_properties_label=文檔屬性…
document_properties_file_name=文件名:
document_properties_file_size=文件大小:
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
document_properties_kb={{size_kb}} KB ({{size_b}} 字節(jié))
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
# will be replaced by the PDF file size in megabytes, respectively in bytes.
document_properties_mb={{size_mb}} MB ({{size_b}} 字節(jié))
document_properties_title=標(biāo)題:
document_properties_author=作者:
document_properties_subject=主題:
document_properties_keywords=關(guān)鍵詞:
document_properties_creation_date=創(chuàng)建日期:
document_properties_modification_date=修改日期:
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
# will be replaced by the creation/modification date, and time, of the PDF file.
document_properties_date_string={{date}}, {{time}}
document_properties_creator=創(chuàng)建者:
document_properties_producer=PDF 生成器:
document_properties_version=PDF 版本:
document_properties_page_count=頁(yè)數(shù):
document_properties_page_size=頁(yè)面大小:
document_properties_page_size_unit_inches=英寸
document_properties_page_size_unit_millimeters=毫米
document_properties_page_size_orientation_portrait=縱向
document_properties_page_size_orientation_landscape=橫向
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=文本
document_properties_page_size_name_legal=法律
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}}({{orientation}})
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}}({{name}},{{orientation}})
# LOCALIZATION NOTE (document_properties_linearized): The linearization status of
# the document; usually called "Fast Web View" in English locales of Adobe software.
document_properties_linearized=快速 Web 視圖:
document_properties_linearized_yes=是
document_properties_linearized_no=否
document_properties_close=關(guān)閉
print_progress_message=正在準(zhǔn)備打印文檔…
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
# a numerical per cent value.
print_progress_percent={{progress}}%
print_progress_close=取消
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
toggle_sidebar.title=切換側(cè)欄
toggle_sidebar_notification2.title=切換側(cè)欄(文檔所含的大綱/附件/圖層)
toggle_sidebar_label=切換側(cè)欄
document_outline.title=顯示文檔大綱(雙擊展開(kāi)/折疊所有項(xiàng))
document_outline_label=文檔大綱
attachments.title=顯示附件
attachments_label=附件
layers.title=顯示圖層(雙擊即可將所有圖層重置為默認(rèn)狀態(tài))
layers_label=圖層
thumbs.title=顯示縮略圖
thumbs_label=縮略圖
current_outline_item.title=查找當(dāng)前大綱項(xiàng)目
current_outline_item_label=當(dāng)前大綱項(xiàng)目
findbar.title=在文檔中查找
findbar_label=查找
additional_layers=其他圖層
# LOCALIZATION NOTE (page_landmark): "{{page}}" will be replaced by the page number.
page_landmark=第 {{page}} 頁(yè)
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
thumb_page_title=第 {{page}} 頁(yè)
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
# number.
thumb_page_canvas=頁(yè)面 {{page}} 的縮略圖
# Find panel button title and messages
find_input.title=查找
find_input.placeholder=在文檔中查找…
find_previous.title=查找詞語(yǔ)上一次出現(xiàn)的位置
find_previous_label=上一頁(yè)
find_next.title=查找詞語(yǔ)后一次出現(xiàn)的位置
find_next_label=下一頁(yè)
find_highlight=全部高亮顯示
find_match_case_label=區(qū)分大小寫
find_match_diacritics_label=匹配變音符號(hào)
find_entire_word_label=全詞匹配
find_reached_top=到達(dá)文檔開(kāi)頭,從末尾繼續(xù)
find_reached_bottom=到達(dá)文檔末尾,從開(kāi)頭繼續(xù)
# LOCALIZATION NOTE (find_match_count): The supported plural forms are
# [one|two|few|many|other], with [other] as the default value.
# "{{current}}" and "{{total}}" will be replaced by a number representing the
# index of the currently active find result, respectively a number representing
# the total number of matches in the document.
find_match_count={[ plural(total) ]}
find_match_count[one]=第 {{current}} 項(xiàng),共匹配 {{total}} 項(xiàng)
find_match_count[two]=第 {{current}} 項(xiàng),共匹配 {{total}} 項(xiàng)
find_match_count[few]=第 {{current}} 項(xiàng),共匹配 {{total}} 項(xiàng)
find_match_count[many]=第 {{current}} 項(xiàng),共匹配 {{total}} 項(xiàng)
find_match_count[other]=第 {{current}} 項(xiàng),共匹配 {{total}} 項(xiàng)
# LOCALIZATION NOTE (find_match_count_limit): The supported plural forms are
# [zero|one|two|few|many|other], with [other] as the default value.
# "{{limit}}" will be replaced by a numerical value.
find_match_count_limit={[ plural(limit) ]}
find_match_count_limit[zero]=超過(guò) {{limit}} 項(xiàng)匹配
find_match_count_limit[one]=超過(guò) {{limit}} 項(xiàng)匹配
find_match_count_limit[two]=超過(guò) {{limit}} 項(xiàng)匹配
find_match_count_limit[few]=超過(guò) {{limit}} 項(xiàng)匹配
find_match_count_limit[many]=超過(guò) {{limit}} 項(xiàng)匹配
find_match_count_limit[other]=超過(guò) {{limit}} 項(xiàng)匹配
find_not_found=找不到指定詞語(yǔ)
# Error panel labels
error_more_info=更多信息
error_less_info=更少信息
error_close=關(guān)閉
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
# replaced by the PDF.JS version and build ID.
error_version_info=PDF.js v{{version}} (build: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=信息:{{message}}
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
# trace.
error_stack=堆棧:{{stack}}
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=文件:{{file}}
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
error_line=行號(hào):{{line}}
# Predefined zoom values
page_scale_width=適合頁(yè)寬
page_scale_fit=適合頁(yè)面
page_scale_auto=自動(dòng)縮放
page_scale_actual=實(shí)際大小
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
# numerical scale value.
page_scale_percent={{scale}}%
# Loading indicator messages
loading=正在加載…
# Loading indicator messages
loading_error=加載 PDF 時(shí)發(fā)生錯(cuò)誤。
invalid_file_error=無(wú)效或損壞的 PDF 文件。
missing_file_error=缺少 PDF 文件。
unexpected_response_error=意外的服務(wù)器響應(yīng)。
rendering_error=渲染頁(yè)面時(shí)發(fā)生錯(cuò)誤。
# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be
# replaced by the modification date, and time, of the annotation.
annotation_date_string={{date}},{{time}}
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type.alt=[{{type}} 注釋]
password_label=輸入密碼以打開(kāi)此 PDF 文件。
password_invalid=密碼無(wú)效。請(qǐng)重試。
password_ok=確定
password_cancel=取消
printing_not_supported=警告:此瀏覽器尚未完整支持打印功能。
printing_not_ready=警告:此 PDF 未完成加載,無(wú)法打印。
web_fonts_disabled=Web 字體已被禁用:無(wú)法使用嵌入的 PDF 字體。
# Editor
editor_free_text2.title=文本
editor_free_text2_label=文本
editor_ink2.title=繪圖
editor_ink2_label=繪圖
free_text2_default_content=開(kāi)始輸入…
# Editor Parameters
editor_free_text_color=顏色
editor_free_text_size=字號(hào)
editor_ink_color=顏色
editor_ink_thickness=粗細(xì)
editor_ink_opacity=不透明度
# Editor aria
editor_free_text2_aria_label=文本編輯器
editor_ink2_aria_label=繪圖編輯器
editor_ink_canvas_aria_label=用戶創(chuàng)建圖像7.在index.html引入當(dāng)前文件
// index.html在src文件同級(jí) <link rel="resource" type="application/l10n" href="./viewer.properties" rel="external nofollow" >
最終效果

到此這篇關(guān)于Vue3實(shí)現(xiàn)pdf預(yù)覽功能的文章就介紹到這了,更多相關(guān)Vue3 pdf預(yù)覽內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
vue中watch監(jiān)聽(tīng)器的觸發(fā)時(shí)機(jī)(watch的坑及解決)
這篇文章主要介紹了vue中watch監(jiān)聽(tīng)器的觸發(fā)時(shí)機(jī)(watch的坑及解決),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-04-04
vue 獲取視頻時(shí)長(zhǎng)的實(shí)例代碼
這篇文章主要介紹了vue 獲取視頻時(shí)長(zhǎng)的實(shí)例代碼,代碼簡(jiǎn)單易懂,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-08-08
vue3?騰訊地圖設(shè)置簽到范圍并獲取經(jīng)緯度的實(shí)現(xiàn)代碼
本文給大家介紹vue3?騰訊地圖設(shè)置簽到范圍并獲取經(jīng)緯度的實(shí)現(xiàn)代碼,本文通過(guò)示例代碼給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧2022-05-05
Vue文件的組織結(jié)構(gòu)不合理之優(yōu)化項(xiàng)目結(jié)構(gòu)詳解
在這篇博客中,我們將探討 Vue 文件組織結(jié)構(gòu)不合理的幾個(gè)常見(jiàn)問(wèn)題,并提供解決方案,以幫助開(kāi)發(fā)者創(chuàng)建更清晰、更高效的項(xiàng)目文件結(jié)構(gòu),希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2025-03-03
React之input動(dòng)態(tài)取值和賦值方式
這篇文章主要介紹了React之input動(dòng)態(tài)取值和賦值方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-05-05
Vue數(shù)據(jù)與事件綁定以及Class和Style的綁定詳細(xì)講解
這篇文章主要介紹了Vue數(shù)據(jù)與事件綁定以及Class和Style的綁定,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧2023-01-01
VueX瀏覽器刷新如何實(shí)現(xiàn)保存數(shù)據(jù)
這篇文章主要介紹了VueX瀏覽器刷新如何實(shí)現(xiàn)保存數(shù)據(jù),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-07-07

