jvs-pdf-app
v0.2.2
Published
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Downloads
27
Readme
Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup>
SFCs, check out the script setup docs to learn more.
Recommended IDE Setup
- VS Code + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Type Support For .vue
Imports in TS
TypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
- Disable the built-in TypeScript Extension
- Run
Extensions: Show Built-in Extensions
from VSCode's command palette - Find
TypeScript and JavaScript Language Features
, right click and selectDisable (Workspace)
- Run
- Reload the VSCode window by running
Developer: Reload Window
from the command palette.
设置国际化
安装好插件后需要再依赖路径下面把PDFJS文件夹复制到当前项目的静态文件地址才能使用国际化功能
并在index.html 添加 以下样式连接
<link rel="stylesheet" type="application/l10n" href="./PDFJS/l10n/locale.json">
设置显示使用的工具栏
{
sidebar: {
viewThumbnail: true,
viewOutline: true,
viewAttachments: true,
viewLayers: true
},
secondaryToolbar: {
secondaryPresentationMode: true,
secondaryOpenFile: true,
secondaryPrint: true,
secondaryDownload: true,
secondaryViewBookmark: true,
firstPage: true,
lastPage: true,
pageRotateCw: true,
pageRotateCcw: true,
cursorSelectTool: true,
cursorHandTool: true,
scrollVertical: true,
scrollHorizontal: true,
scrollWrapped: true,
spreadNone: true,
spreadOdd: true,
spreadEven: true,
documentProperties: true
},
toolbar: {
toolbarViewerLeft: {
findbar: true,
previous: true,
next: true,
pageNumber: true
},
toolbarViewerRight: {
presentationMode: true,
openFile: true,
print: true,
download: true,
viewBookmark: true,
editorHighlight:false,
editorFreeText:false,
editorInk:false,
editorStamp:false,
},
toolbarViewerMiddle: {
zoomOut: true,
zoomIn: true,
scaleSelectContainer: true
}
},
errorWrapper: true
}
自定义工具栏的按钮监听实现自定义布局
{
cursorHandTool?: string;
cursorSelectTool?: string;
documentProperties?: string;
download?: string;
findbar?: string;
findEntireWord?: string;
findHighlightAll?: string;
findInput?: string;
findMatchCase?: string;
findMessage?: string;
findNext?: string;
findPrevious?: string;
findResultsCount?: string;
firstPage?: string;
lastPage?: string;
nextPage?: string;
numPages?: string;
openFile?: string;
pageNumber?: string;
pageRotateCcw?: string;
pageRotateCw?: string;
presentationMode?: string;
previousPage?: string;
print?: string;
scrollHorizontal?: string;
scrollVertical?: string;
scrollWrapped?: string;
sidebarToggle?: string;
spreadEven?: string;
spreadNone?: string;
spreadOdd?: string;
toggleFindbar?: string;
viewAttachments?: string;
viewBookmark?: string;
viewOutline?: string;
viewThumbnail?: string;
zoomIn?: string;
zoomOut?: string;
scaleSelect?: string;
customScaleOption?: string;
editorFreeText?: string;
editorHighlight?: string;
editorInk?: string;
editorStamp?: string;
editorFreeTextParamsToolbar?: string;
editorHighlightParamsToolbar?: string;
editorInkParamsToolbar?: string;
editorStampParamsToolbar?: string;
editorHighlightColorPicker?: string;
language?: string;
baseUrl?: string;
printType?: string;
printTitle?: string;
setTitle?: boolean;
}