Commit 65873ad2 authored by NataliaTepluhina's avatar NataliaTepluhina

Update Vue mounting instructions

parent cb4db18b
......@@ -64,11 +64,11 @@ which will make the tests easier. See the following example:
```javascript
// haml
.js-vue-app{ data: { endpoint: 'foo' }}
#js-vue-app{ data: { endpoint: 'foo' }}
// index.js
document.addEventListener('DOMContentLoaded', () => new Vue({
el: '.js-vue-app',
el: '#js-vue-app',
data() {
const dataset = this.$options.el.dataset;
return {
......@@ -85,6 +85,8 @@ document.addEventListener('DOMContentLoaded', () => new Vue({
}));
```
> When adding an `id` attribute to mount a Vue application, please make sure this `id` is unique across the codebase
#### Accessing the `gl` object
When we need to query the `gl` object for data that won't change during the application's life cycle, we should do it in the same place where we query the DOM.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment