with-vue icon indicating copy to clipboard operation
with-vue copied to clipboard

How to use with script setup?

Open capoia opened this issue 11 months ago • 0 comments

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>

capoia avatar Aug 09 '23 00:08 capoia