Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update introduction.md #2784

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/guide/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Here is a minimal example:
<div class="options-api">

```js
<script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion! However, we cannot simply put <script> tag in js code block. We'd need to have vue-html block (we can merge it with the next one) and then put the tag there:

<!--```vue-html -->
<script>
 // script part
 </script>

<template>
  // template part
</template>

import { createApp } from 'vue'

createApp({
Expand All @@ -41,12 +42,14 @@ createApp({
}
}
}).mount('#app')
</script>
```

</div>
<div class="composition-api">

```js
<script>
import { createApp, ref } from 'vue'

createApp({
Expand All @@ -56,16 +59,19 @@ createApp({
}
}
}).mount('#app')
</script>
```

</div>

```vue-html
<template>
<div id="app">
<button @click="count++">
Count is: {{ count }}
</button>
</div>
</template>
```

**Result**
Expand All @@ -75,11 +81,13 @@ import { ref } from 'vue'
const count = ref(0)
</script>

<template>
<div class="demo">
<button @click="count++">
Count is: {{ count }}
</button>
</div>
</template>

The above example demonstrates the two core features of Vue:

Expand Down