You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A `*.vue`file is a custom file format that uses HTML-like syntax to describe a Vue component. Each `*.vue`file consists of three types of top-level language blocks: `<template>`, `<script>`, and`<style>`, and optionally additional custom blocks:
-Contents will be extracted and passed on to `@vue/compiler-dom`, pre-compiled into JavaScript render functions, and attached to the exported component as its `render`option.
-The **default export**should be a Vue component options object, either as a plain object or as the return value of [defineComponent](/api/global-api.html#definecomponent).
-The script is pre-processed and used as the component's `setup()`function, which means it will be executed **for each instance of the component**. Top-level bindings in `<script setup>`are automatically exposed to the template. For more details, see [dedicated documentation on `<script setup>`](/api/sfc-script-setup).
-A single`*.vue`file can contain multiple `<style>`tags.
57
+
-1 つの`*.vue`ファイルには複数の `<style>`タグを含めることができます。
58
58
59
-
-A `<style>`tag can have `scoped`or`module`attributes (see [SFC Style Features](/api/sfc-style)for more details) to help encapsulate the styles to the current component. Multiple `<style>`tags with different encapsulation modes can be mixed in the same component.
Additional custom blocks can be included in a `*.vue`file for any project-specific needs, for example a `<docs>` block. Some real-world examples of custom blocks include:
Handling of Custom Blocks will depend on tooling - if you want to build your own custom block integrations, see [SFC Tooling](/api/sfc-tooling.html#custom-blocks-integration)for more details.
An SFC automatically infers the component's name from its **filename**in the following cases:
73
+
SFC は次のようなケースで **ファイル名**からコンポーネント名を自動で推測します:
74
74
75
-
-Dev warning formatting
76
-
- DevTools inspection
77
-
-Recursive self-reference. E.g. a file named `FooBar.vue`can refer to itself as `<FooBar/>`in its template. This has lower priority than explicity registered/imported components.
`lang`can be applied to any block - for example we can use `<style>`with[SASS](https://sass-lang.com/)and`<template>`with[Pug](https://pugjs.org/api/getting-started.html):
Inside each block you shall use the comment syntax of the language being used (HTML, CSS, JavaScript, Pug, etc.). For top-level comments, use HTML comment syntax: `<!-- comment contents here -->`
139
+
各ブロック内では、使用している言語(HTML、CSS、JavaScript、Pug など)のコメント構文を使用してください。トップレベルのコメントには、HTML コメント構文を使用します: `<!-- comment contents here -->`
0 commit comments