随笔分类 - astro
摘要:1. 创建工程 pnpm create @qwik.dev/astro@latest 2. 删除biome.json 3. 升级biome到最新版 4. 生成biome.json biome init 5. 修改biome.json 添加: "overrides": [ { "includes":
阅读全文
摘要:在biome.json中添加: "overrides": [ { "includes": ["**/*.svelte", "**/*.astro", "**/*.vue"], "linter": { "rules": { "style": { "useConst": "off", "useImpor
阅读全文
摘要:Astro 的编译/构建速度受多种因素影响(项目规模、依赖、配置、硬件等),下面我会从配置优化、依赖管理、构建策略、开发环境四个维度,给出可直接落地的加速方案,每个方案都包含具体操作和原理说明。 一、核心配置优化(立竿见影) 1. 启用 Astro 内置的缓存和优化 Astro 自带缓存机制,但默认
阅读全文
摘要:src/components/AceMarkdown.tsx: import { useRef, useEffect, useState } from "react"; import { $paper, type Paper } from "../store/paper"; import ace f
阅读全文
摘要:src/components/Counter.tsx: import { useState } from "react"; interface CounterProps { count: number; } export const Counter = ({ count }: CounterProp
阅读全文
摘要:src/components/ace-markdown.ts: import { LitElement, css, html } from "lit"; import { customElement, property, query } from "lit/decorators.js"; // im
阅读全文
摘要:在vite + lit中调试好的代码my.counter.ts: import { LitElement, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; import { st
阅读全文
摘要:MyCounter.astro: <script> const template = ` <style> * { font-size: 200%; } span { width: 4rem; display: inline-block; text-align: center; } button {
阅读全文
摘要:先创建AstroHeart.astro: <astro-heart> <button aria-label="Heart">💜</button> × <span>0</span> </astro-heart> <script> // Define the behaviour for our new
阅读全文
摘要:import Editor from "@monaco-editor/react"; import { useState } from "react"; import Markdown from "react-markdown"; import rehypeHighlight from "rehyp
阅读全文
摘要:cherry-markdown是一个TS编写的markdown编辑器。 import "cherry-markdown/dist/cherry-markdown.css"; <cherry-mark> <textarea></textarea> </cherry-mark> <script> imp
阅读全文

浙公网安备 33010602011771号