Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with script setup? #6

Open
capoia opened this issue Aug 9, 2023 · 0 comments
Open

How to use with script setup? #6

capoia opened this issue Aug 9, 2023 · 0 comments

Comments

@capoia
Copy link

capoia commented Aug 9, 2023

Hello, first of all thank you very much for the framework, it works incredibly well besides being super simple.

I would like to know if there is any way to use the vue 3 setup script? I tried to adapt (as you can see below), but the styles were not injected.

<script setup lang="ts">
import cssText from "data-text:~/contents/plasmo-overlay.css"
import type { PlasmoCSConfig, PlasmoGetStyle } from "plasmo"

const config: PlasmoCSConfig = {
  matches: ["https://web.whatsapp.com/"]
}

const getStyle: PlasmoGetStyle = () => {
  const style = document.createElement("style")
  style.textContent = cssText
  return style
}

const plasmo = {
  getStyle
}

</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant