alexjoverm / alexjoverm/v-runtime-template

Using v-runtime-template within a slot

Offen
#63 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
601
Forks
71
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Just documenting this here as it took me awhile to solve this as it was not documented. Solved by code inspection.

If you want to pass some other props into the v-runtime-template's component, you can use

```ts
data: () => ({
template: `

{{parentProp1}} {{prop}}
`,
}),
```

```vue

```

This seems to be required if you

- trying to access v-for variables
- using v-runtime-template within a slot, limiting you to parent component props, not slot scope

Hope this saves people some time in the future.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.