Skip to content

Missing: Support for Vue's <script setup> #1194

@Lightwight

Description

@Lightwight

Versions

VueApm-Plugin (RUM-Agent): ^2.0.1
Vue: ^3.0.0

Problem

I am not able to use your fantastic Apm-Plugin inside a Vue3-<script setup>-Component because of the missing provide mechanism.
In order to make this possible the plugin itself needs to use the inject mechanism:

Solution

APM-Plugin
export default { install: (app, options) => { const $apm = () => { ... }; app.provide("$apm", $apm); } };

Then I can use it inside my Setup-Template
<script setup> import { inject } from "vue"; const $apm = inject("$apm"); </setup>

Would be nice if you can implement the support for Vue3-Setup-Templates.
Thanks 🙏

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions