refactor: Array.from(iterable).map(mapfn)をArray.from(iterable | { length: number }, mapfn)に (#11337)
* refactor: Array.from(iterable).map(mapfn)をArray.from(iterable, mapfn)に * Update packages/frontend/src/components/MkTagCloud.vue Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> --------- Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
This commit is contained in:
		| @@ -540,7 +540,7 @@ function onCompositionEnd(ev: CompositionEvent) { | ||||
| } | ||||
|  | ||||
| async function onPaste(ev: ClipboardEvent) { | ||||
| 	for (const { item, i } of Array.from(ev.clipboardData.items).map((item, i) => ({ item, i }))) { | ||||
| 	for (const { item, i } of Array.from(ev.clipboardData.items, (item, i) => ({ item, i }))) { | ||||
| 		if (item.kind === 'file') { | ||||
| 			const file = item.getAsFile(); | ||||
| 			const lio = file.name.lastIndexOf('.'); | ||||
|   | ||||
| @@ -16,8 +16,8 @@ import tinycolor from 'tinycolor2'; | ||||
| const loaded = !!window.TagCanvas; | ||||
| const SAFE_FOR_HTML_ID = 'abcdefghijklmnopqrstuvwxyz'; | ||||
| const computedStyle = getComputedStyle(document.documentElement); | ||||
| const idForCanvas = Array.from(Array(16)).map(() => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)]).join(''); | ||||
| const idForTags = Array.from(Array(16)).map(() => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)]).join(''); | ||||
| const idForCanvas = Array.from({ length: 16 }, () => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)]).join(''); | ||||
| const idForTags = Array.from({ length: 16 }, () => SAFE_FOR_HTML_ID[Math.floor(Math.random() * SAFE_FOR_HTML_ID.length)]).join(''); | ||||
| let available = $ref(false); | ||||
| let rootEl = $shallowRef<HTMLElement | null>(null); | ||||
| let canvasEl = $shallowRef<HTMLCanvasElement | null>(null); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 tamaina
					tamaina