Skip to content
Open
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
16 changes: 8 additions & 8 deletions docs/5.x/vue-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class MyStore {
increment() {
this.myState.counter += 1;
}

decrement() {
this.myState.counter -= 1;
}
Expand Down Expand Up @@ -156,15 +156,15 @@ class GoalsStore
});

readonly allGoals = computed(() => readonly(this.state).goals);

readonly currentGoal = computed(() => {
const idGoal = MatomoUrl.parsed.value.idGoal;
if (idGoal && this.state.goals[idGoal]) {
return readonly(this.state.goals[idGoal]);
}
return undefined;
});

changeGoal(idGoal: number): void {
MatomoUrl.updateHash({
// NOTE: updateHash will rewrite the entire hash, so it is important to include existing query parameters,
Expand Down Expand Up @@ -242,18 +242,18 @@ import { AjaxHelper } from 'CoreHome';
AjaxHelper.fetch<[ResponseType1, ResponseType2]>([
{
method: 'MyPlugin.firstApiRequest',
// ...
// ...
},
{
method: 'MyPlugin.secondApiRequest',
// ...
// ...
},
]).then(([r1, r2]) => {
// use r1, r2
});
```

### Using Vue components outside of Vue
### Using Vue components outside of Vue

Sometimes it's necessary to initiate and use a Vue component from a different context, such as in
a twig template or in raw HTML. This can be accomplished through the use of the `vue-entry` attribute
Expand All @@ -272,8 +272,8 @@ Add this attribute to your HTML like so:
```html
<div
vue-entry="MyPlugin.MyComponent"
prop-value="&quot;value for propValue property&quot;"
my-other-property="{&quot;name&quot;: &quot;the name&quot;}"
prop-value="value for propValue property"
my-other-property="{'name': 'the name'}"
></div>
```

Expand Down