Skip to content

Commit 83d3a9a

Browse files
committed
fix
1 parent 425075f commit 83d3a9a

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

src/guide/scaling-up/sfc.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ export default {
3535

3636
```vue
3737
<script setup>
38-
import { ref } from 'vue';
39-
const greeting = ref('Hello World!');
38+
import { ref } from 'vue'
39+
const greeting = ref('Hello World!')
4040
}
4141
</script>
4242
@@ -81,36 +81,16 @@ That said, we do realize there are scenarios where SFCs can feel like overkill.
8181

8282
Vue SFC is a framework-specific file format and must be pre-compiled by [@vue/compiler-sfc](https://github.com/vuejs/core/tree/main/packages/compiler-sfc) into standard JavaScript and CSS. A compiled SFC is a standard JavaScript (ES) module - which means with proper build setup you can import an SFC like a module:
8383

84-
<div class="options-api">
85-
86-
```vue
87-
88-
<script>
89-
import MyComponent from './MyComponent.vue';
84+
```js
85+
import MyComponent from './MyComponent.vue'
9086

9187
export default {
9288
components: {
9389
MyComponent
9490
}
9591
}
96-
</script>
9792
```
9893

99-
</div>
100-
101-
<div class="composition-api">
102-
103-
```vue
104-
<script setup>
105-
import MyComponent from './MyComponent.vue';
106-
107-
</script>
108-
```
109-
110-
With `<script setup>`, imported components are automatically made available to the template.
111-
112-
</div>
113-
11494
`<style>` tags inside SFCs are typically injected as native `<style>` tags during development to support hot updates. For production they can be extracted and merged into a single CSS file.
11595

11696
You can play with SFCs and explore how they are compiled in the [Vue SFC Playground](https://sfc.vuejs.org/).

0 commit comments

Comments
 (0)