0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Solid.js: SVG の使い方 (TypeScript)

Last updated at Posted at 2022-06-24

次のページを参考にしました。
導入/JSX

プロジェクトの作成

npx degit solidjs/templates/ts svg01
cd svg01
npm i
npm run dev

src/App.tsx を改造

src/App.tsx
import type { Component } from 'solid-js';
import { render } from 'solid-js/web';

const App: Component = () => {
  return (
    <>
      <div>Five Circles</div>
	<blockquote>
      <div>Jun/24/2022</div>
	</blockquote>
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
  <circle cx="30" cy="20" r="10" stroke="cyan" fill="none"/>
  <circle cx="50" cy="20" r="10" stroke="black" fill="none"/>
  <circle cx="70" cy="20" r="10" stroke="red" fill="none"/>
  <circle cx="40" cy="37.32" r="10" stroke="yellow" fill="none"/>
  <circle cx="60" cy="37.32" r="10" stroke="green" fill="none"/>
</svg>
    </>
  )

}

export default App

ブラウザーで http://localhost:3000/ にアクセス

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?