Skip to content

Commit 4c7b894

Browse files
committed
Update quick-start.md
1 parent aac00ea commit 4c7b894

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/guide/quick-start.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,29 @@ To get started with Vue without a build step, simply copy the following code int
8383
}).mount('#app')
8484
</script>
8585
```
86-
8786
The above example uses the global build of Vue where all APIs are exposed under the global `Vue` variable.
8887

88+
To use **ref** or any vue 3 features, simply add **const { ref } = Vue**
89+
90+
91+
```html
92+
<script src="https://unpkg.com/vue@3"></script>
93+
94+
<div id="app">{{ message }} {{version}}</div>
95+
96+
<script>
97+
const { ref } = Vue
98+
Vue.createApp({
99+
setup(){
100+
const version = ref(3)
101+
const message = ref('Hello Vue')
102+
return {message,version}
103+
}
104+
}).mount('#app')
105+
</script>
106+
```
107+
108+
89109
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:
90110

91111
```html

0 commit comments

Comments
 (0)