Skip to content

Update quick-start without building #1677

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/guide/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,29 @@ To get started with Vue without a build step, simply copy the following code int
}).mount('#app')
</script>
```

The above example uses the global build of Vue where all APIs are exposed under the global `Vue` variable.

To use **ref** or any vue 3 features, simply add **const { ref } = Vue**


```html
<script src="https://unpkg.com/vue@3"></script>

<div id="app">{{ message }} {{version}}</div>

<script>
const { ref } = Vue
Vue.createApp({
setup(){
const version = ref(3)
const message = ref('Hello Vue')
return {message,version}
}
}).mount('#app')
</script>
```


While the global build works, we will be primarily using [ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) syntax throughout the rest of the documentation for consistency. In order to use Vue over native ES modules, use the following HTML instead:

```html
Expand Down