each遍歷 $colors: ( #00D477, #F57933, #0052F5 ); @each $c in $colors { $i: index($colors, $c); .tag-#{$i} { background-color: $c; } } 生成的結果如下: .tag-1 { ba
在使用react-router-dom的時候,用到了useMatches的方法,ts一直提示報錯,如下: 根據提示,找到了這個類型: export interface UIMatchData = unknown, Handle = unknown { id: string; pathname: string; params: AgnosticRouteMatch["
以下功能基於puppeteer實現 中文文檔 英文文檔 引入插件,並且打開啓動 const puppeteer = require('puppeteer'); (async () = { browser = await puppeteer.launch({ headless: true, // defaultViewport: { width
實現一個小功能,遠程url轉為file對象 方案一: function getFileFromUrl(url: string, fileName: string) { return new Promise(async (resolve, reject) = { const response = await fetch(url); const blob = await re
vue中實現頁面導出pdf的功能 所需插件 html2canvas和pdfmake 原理就是將頁面截圖,然後生成pdf文件,具體代碼如下 const main = ref() async function exportPdf() { const canvas = await html2canvas(main.value, { allowTaint: true, scal
1. 變量聲明及使用 $color: red; .box { color: $color; } 2. mixin和include 2.1 簡單使用 $bgColor: red; @mixin bg { background: $bgColor; } .box { @include bg; } 編譯結果: .box { background: red; } 2.2 進