Skip to content

Commit 1c3cbb3

Browse files
committed
feat: VueToPrint first commit
1 parent c94433b commit 1c3cbb3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+15694
-0
lines changed

.eslintrc.cjs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-env node */
2+
require("@rushstack/eslint-patch/modern-module-resolution");
3+
4+
module.exports = {
5+
root: true,
6+
extends: [
7+
"plugin:vue/vue3-essential",
8+
"eslint:recommended",
9+
"@vue/eslint-config-typescript",
10+
"@vue/eslint-config-prettier/skip-formatting"
11+
],
12+
/**
13+
* eslint 默认行为是忽略以 `.` 开头的文件 / 文件夹. 但是我们需要对 `.vitepress` 目录下的文件进行检查.
14+
* @see https://stackoverflow.com/questions/57947585/eslint-warning-file-ignored-by-default-use-a-negated-ignore-pattern
15+
*/
16+
ignorePatterns: ["!.vitepress"],
17+
18+
parserOptions: {
19+
ecmaVersion: "latest"
20+
}
21+
};

.gitattributes

+292
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,292 @@
1+
## from https://www.richie-bendall.ml/gitattributes-generator
2+
# Common settings that generally should always be used with your language specific settings
3+
4+
# Auto detect text files and perform LF normalization
5+
* text=auto
6+
7+
#
8+
# The above will handle all files NOT found below
9+
#
10+
11+
# Documents
12+
*.bibtex text diff=bibtex
13+
*.doc diff=astextplain
14+
*.DOC diff=astextplain
15+
*.docx diff=astextplain
16+
*.DOCX diff=astextplain
17+
*.dot diff=astextplain
18+
*.DOT diff=astextplain
19+
*.pdf diff=astextplain
20+
*.PDF diff=astextplain
21+
*.rtf diff=astextplain
22+
*.RTF diff=astextplain
23+
*.md text diff=markdown
24+
*.mdx text diff=markdown
25+
*.tex text diff=tex
26+
*.adoc text
27+
*.textile text
28+
*.mustache text
29+
*.csv text
30+
*.tab text
31+
*.tsv text
32+
*.txt text
33+
*.sql text
34+
*.epub diff=astextplain
35+
36+
# Graphics
37+
*.png binary
38+
*.jpg binary
39+
*.jpeg binary
40+
*.gif binary
41+
*.tif binary
42+
*.tiff binary
43+
*.ico binary
44+
# SVG treated as text by default.
45+
*.svg text
46+
# If you want to treat it as binary,
47+
# use the following line instead.
48+
# *.svg binary
49+
*.eps binary
50+
51+
# Scripts
52+
*.bash text eol=lf
53+
*.fish text eol=lf
54+
*.sh text eol=lf
55+
*.zsh text eol=lf
56+
# These are explicitly windows files and should use crlf
57+
*.bat text eol=crlf
58+
*.cmd text eol=crlf
59+
*.ps1 text eol=crlf
60+
61+
# Serialisation
62+
*.json text
63+
*.toml text
64+
*.xml text
65+
*.yaml text
66+
*.yml text
67+
68+
# Archives
69+
*.7z binary
70+
*.gz binary
71+
*.tar binary
72+
*.tgz binary
73+
*.zip binary
74+
75+
# Text files where line endings should be preserved
76+
*.patch -text
77+
78+
#
79+
# Exclude files from exporting
80+
#
81+
82+
.gitattributes export-ignore
83+
.gitignore export-ignore
84+
.gitkeep export-ignore
85+
86+
## GITATTRIBUTES FOR WEB PROJECTS
87+
#
88+
# These settings are for any web project.
89+
#
90+
# Details per file setting:
91+
# text These files should be normalized (i.e. convert CRLF to LF).
92+
# binary These files are binary and should be left untouched.
93+
#
94+
# Note that binary is a macro for -text -diff.
95+
######################################################################
96+
97+
# Auto detect
98+
## Handle line endings automatically for files detected as
99+
## text and leave all files detected as binary untouched.
100+
## This will handle all files NOT defined below.
101+
* text=auto
102+
103+
# Source code
104+
*.bash text eol=lf
105+
*.bat text eol=crlf
106+
*.cmd text eol=crlf
107+
*.coffee text
108+
*.css text diff=css
109+
*.htm text diff=html
110+
*.html text diff=html
111+
*.inc text
112+
*.ini text
113+
*.js text
114+
*.json text
115+
*.jsx text
116+
*.less text
117+
*.ls text
118+
*.map text -diff
119+
*.od text
120+
*.onlydata text
121+
*.php text diff=php
122+
*.pl text
123+
*.ps1 text eol=crlf
124+
*.py text diff=python
125+
*.rb text diff=ruby
126+
*.sass text
127+
*.scm text
128+
*.scss text diff=css
129+
*.sh text eol=lf
130+
.husky/* text eol=lf
131+
*.sql text
132+
*.styl text
133+
*.tag text
134+
*.ts text
135+
*.tsx text
136+
*.xml text
137+
*.xhtml text diff=html
138+
139+
# Docker
140+
Dockerfile text
141+
142+
# Documentation
143+
*.ipynb text eol=lf
144+
*.markdown text diff=markdown
145+
*.md text diff=markdown
146+
*.mdwn text diff=markdown
147+
*.mdown text diff=markdown
148+
*.mkd text diff=markdown
149+
*.mkdn text diff=markdown
150+
*.mdtxt text
151+
*.mdtext text
152+
*.txt text
153+
AUTHORS text
154+
CHANGELOG text
155+
CHANGES text
156+
CONTRIBUTING text
157+
COPYING text
158+
copyright text
159+
*COPYRIGHT* text
160+
INSTALL text
161+
license text
162+
LICENSE text
163+
NEWS text
164+
readme text
165+
*README* text
166+
TODO text
167+
168+
# Templates
169+
*.dot text
170+
*.ejs text
171+
*.erb text
172+
*.haml text
173+
*.handlebars text
174+
*.hbs text
175+
*.hbt text
176+
*.jade text
177+
*.latte text
178+
*.mustache text
179+
*.njk text
180+
*.phtml text
181+
*.svelte text
182+
*.tmpl text
183+
*.tpl text
184+
*.twig text
185+
*.vue text
186+
187+
# Configs
188+
*.cnf text
189+
*.conf text
190+
*.config text
191+
.editorconfig text
192+
.env text
193+
.gitattributes text
194+
.gitconfig text
195+
.htaccess text
196+
*.lock text -diff
197+
package.json text eol=lf
198+
package-lock.json text eol=lf -diff
199+
pnpm-lock.yaml text eol=lf -diff
200+
.prettierrc text
201+
yarn.lock text -diff
202+
*.toml text
203+
*.yaml text
204+
*.yml text
205+
browserslist text
206+
Makefile text
207+
makefile text
208+
209+
# Heroku
210+
Procfile text
211+
212+
# Graphics
213+
*.ai binary
214+
*.bmp binary
215+
*.eps binary
216+
*.gif binary
217+
*.gifv binary
218+
*.ico binary
219+
*.jng binary
220+
*.jp2 binary
221+
*.jpg binary
222+
*.jpeg binary
223+
*.jpx binary
224+
*.jxr binary
225+
*.pdf binary
226+
*.png binary
227+
*.psb binary
228+
*.psd binary
229+
# SVG treated as an asset (binary) by default.
230+
*.svg text
231+
# If you want to treat it as binary,
232+
# use the following line instead.
233+
# *.svg binary
234+
*.svgz binary
235+
*.tif binary
236+
*.tiff binary
237+
*.wbmp binary
238+
*.webp binary
239+
240+
# Audio
241+
*.kar binary
242+
*.m4a binary
243+
*.mid binary
244+
*.midi binary
245+
*.mp3 binary
246+
*.ogg binary
247+
*.ra binary
248+
249+
# Video
250+
*.3gpp binary
251+
*.3gp binary
252+
*.as binary
253+
*.asf binary
254+
*.asx binary
255+
*.avi binary
256+
*.fla binary
257+
*.flv binary
258+
*.m4v binary
259+
*.mng binary
260+
*.mov binary
261+
*.mp4 binary
262+
*.mpeg binary
263+
*.mpg binary
264+
*.ogv binary
265+
*.swc binary
266+
*.swf binary
267+
*.webm binary
268+
269+
# Archives
270+
*.7z binary
271+
*.gz binary
272+
*.jar binary
273+
*.rar binary
274+
*.tar binary
275+
*.zip binary
276+
277+
# Fonts
278+
*.ttf binary
279+
*.eot binary
280+
*.otf binary
281+
*.woff binary
282+
*.woff2 binary
283+
284+
# Executables
285+
*.exe binary
286+
*.pyc binary
287+
288+
# RC files (like .babelrc or .eslintrc)
289+
*.*rc text
290+
291+
# Ignore files (like .npmignore or .gitignore)
292+
*.*ignore text

.gitignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
.DS_Store
12+
dist
13+
dist-ssr
14+
coverage
15+
*.local
16+
17+
/cypress/videos/
18+
/cypress/screenshots/
19+
20+
# Editor directories and files
21+
.vscode/*
22+
!.vscode/extensions.json
23+
.idea
24+
*.suo
25+
*.ntvs*
26+
*.njsproj
27+
*.sln
28+
*.sw?
29+
30+
# vitepress cache
31+
docs/.vitepress/cache
32+
docs/types
33+
34+
# boundle stats
35+
stats.html

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx lint-staged

.prettierrc.json5

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"trailingComma": "none",
6+
"semi": true,
7+
// 已通过 .gitattributes 配置换行符兼容性. 无需再配置 endOfLine.
8+
"endOfLine": "auto"
9+
}

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3+
}

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# vue-to-print
2+
3+
You've created a Vue component and would love to give end users the ability to print out the contents of that component. This package aims to solve that by popping up a print window with CSS styles copied over as well.
4+
5+
## What is this?
6+
7+
This is the Vue 3.x version of [ReactToPrint](https://github.com/gregnb/react-to-print).
8+
9+
> Thanks to the [contributors](https://github.com/gregnb/react-to-print/graphs/contributors) of `ReactToPrint` whose work made this package possible.
10+
11+
VueToPrint aims to be as consistent as possible with ReactToPrint so that you can use the same API. However, there are some differences due to the differences between Vue 3.x and React. Please refer to the [examples](basic-usage.md) below.
12+
13+
## Documentation
14+
15+
todo

0 commit comments

Comments
 (0)