Skip to content

How add Tailwind in Vue js SFC playground #13563

Answered by alex-krasikau
kr1ke asked this question in Help
Discussion options

You must be logged in to vote

Hey @kr1ke!

You can utilize Tailwind CSS CDN for this. While I'm not a Vue expert, this approach could work. Maybe you can find a better way to integrate it.

<script setup>
import { ref } from 'vue'

const msg = ref('Hello World!')

const tailwindScript = document.createElement('script')
tailwindScript.setAttribute('src', 'https://cdn.tailwindcss.com')
document.head.appendChild(tailwindScript)
</script>

<template>
  <h1 class="text-sm">{{ msg }}</h1>
  <input v-model="msg" />
</template>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@kr1ke
Comment options

Answer selected by kr1ke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants