diff --git a/apps/svelte.dev/content/docs/svelte/01-introduction/03-svelte-files.md b/apps/svelte.dev/content/docs/svelte/01-introduction/03-svelte-files.md index cd9865237..90db800bc 100644 --- a/apps/svelte.dev/content/docs/svelte/01-introduction/03-svelte-files.md +++ b/apps/svelte.dev/content/docs/svelte/01-introduction/03-svelte-files.md @@ -1,41 +1,41 @@ --- -title: .svelte files +title: .svelte ファイル --- -Components are the building blocks of Svelte applications. They are written into `.svelte` files, using a superset of HTML. +コンポーネントは Svelte アプリケーションの構成要素です。これらは `.svelte` ファイルに書かれ、HTML のスーパーセットを使って記述されます。 -All three sections — script, styles and markup — are optional. +以下の3つのセクション — script, styles, markup — は任意です。 ```svelte /// file: MyComponent.svelte - + ``` ## ` ``` -You can `export` bindings from this block, and they will become exports of the compiled module. You cannot `export default`, since the default export is the component itself. +このブロックから `export` バインディングを使用してエクスポートすることができ、それらはコンパイルされたモジュールのエクスポートとして扱われます。ただし、コンポーネント自体にデフォルトエクスポートがされるため `export default` は使用できません。 -> [!NOTE] If you are using TypeScript and import such exports from a `module` block into a `.ts` file, make sure to have your editor setup so that TypeScript knows about them. This is the case for our VS Code extension and the IntelliJ plugin, but in other cases you might need to setup our [TypeScript editor plugin](https://www.npmjs.com/package/typescript-svelte-plugin). +> [!NOTE] TypeScriptを使用していて、`module` ブロックからエクスポートされたものを `.ts` ファイルにインポートする場合は、TypeScriptがそれらを認識できるようにエディタの設定を行う必要があります。VS Code拡張機能やIntelliJプラグインを使用している場合はこの設定が必要となりますが、それ以外の場合は [TypeScript エディタープラグイン](https://www.npmjs.com/package/typescript-svelte-plugin) を設定する必要がある場合があります。 > [!LEGACY] -> In Svelte 4, this script tag was created using `