timonweb / django-tailwind

Django + Tailwind CSS = 💚
https://django-tailwind.readthedocs.io
MIT License
1.46k stars 92 forks source link

I need to include vue3. any advice for me? #64

Closed simkimsia closed 3 years ago

simkimsia commented 3 years ago

Sorry if this is out of scope. If need be, I'm happy to negotiate a support fee to help me with this question. I will write the code myself, but some guidance will be much appreciated.

I am using tailwindui components to build a landing page in my django 3.2 app.

Turns out some js is required and tailwindui only supports vue 3 and react so far.

As previously mentioned, i am a total noob to tailwind and frontend. Was wondering if you have any advice for me to incorporate vue3 within the context of django-tailwind

what the error I saw

image

Uncaught SyntaxError: Cannot use import statement outside a module for

{% block custom_js %}
<script>

    import { defineComponent, h } from 'vue'
    import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'

what i tried

I tried to add the vue3 as cdn in the base.html

didn't work

i added

"vue": "^3.0.11",
    "@headlessui/vue": "^1.0.0",
    "@heroicons/vue": "^1.0.1"

inside theme/static_src/package.json

then i rerun python manage.py tailwind install

still didn't work

timonweb commented 3 years ago

@simkimsia dm me on Twitter.