# Using primevue and other npm package on Dashboard 2.0 ui-template

**URL:** <https://discourse.nodered.org/t/using-primevue-and-other-npm-package-on-dashboard-2-0-ui-template/90123>\
**Category:** Dashboard\
**Tags:** dashboard-2, ui-template\
**Created:** [12 August 2024 10:30 UTC](https://discourse.nodered.org/t/using-primevue-and-other-npm-package-on-dashboard-2-0-ui-template/90123 "2024-08-12T10:30:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raffaele](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@raffaele](https://discourse.nodered.org/u/raffaele)\
**Post date:** [12 August 2024 10:30 UTC](https://discourse.nodered.org/t/using-primevue-and-other-npm-package-on-dashboard-2-0-ui-template/90123/1 "2024-08-12T10:30:14Z")

</div>

Good day,  
I try to use the primevue UI suite with the ui-template in Nodered Dashboard 2.0.  
I installed PrimeVue with the npm in the .node-red directory.

In the ui-template I insert the following code to text an example find on the PrimeVue site.

```auto

<template>
    <div class="card flex justify-center">
        <v-text> "hello world" </v-text>
        <CascadeSelect v-model="selectedCity" :options="countries" optionLabel="cname" optionGroupLabel="name"
            :optionGroupChildren="['states', 'cities']" style="min-width: 14rem" placeholder="Select a City">
            <template #option="slotProps">
                <div class="flex items-center">
                    <img v-if="slotProps.option.states" :alt="slotProps.option.name" src="https://primefaces.org/cdn/primevue/images/flag/flag_placeholder.png" :class="`flag flag-${slotProps.option.code.toLowerCase()} mr-2`" style="width: 18px" />
                    <i v-if="slotProps.option.cities" class="pi pi-compass mr-2"></i>
                    <i v-if="slotProps.option.cname" class="pi pi-map-marker mr-2"></i>
                    <span>{{ slotProps.option.cname || slotProps.option.name }}</span>
                </div>
            </template>
        </CascadeSelect>
    </div>
</template>

<script setup>
import { ref } from "vue";
import CascadeSelect from 'primevue/cascadeselect';
const selectedCity = ref();
const countries = ref([
    {
        name: 'Australia',
        code: 'AU',
        states: [
            {
                name: 'New South Wales',
                cities: [
                    { cname: 'Sydney', code: 'A-SY' },
                    { cname: 'Newcastle', code: 'A-NE' },
                    { cname: 'Wollongong', code: 'A-WO' }
                ]
            },
            {
                name: 'Queensland',
                cities: [
                    { cname: 'Brisbane', code: 'A-BR' },
                    { cname: 'Townsville', code: 'A-TO' }
                ]
            }
        ]
    },
    {
        name: 'Canada',
        code: 'CA',
        states: [
            {
                name: 'Quebec',
                cities: [
                    { cname: 'Montreal', code: 'C-MO' },
                    { cname: 'Quebec City', code: 'C-QU' }
                ]
            },
            {
                name: 'Ontario',
                cities: [
                    { cname: 'Ottawa', code: 'C-OT' },
                    { cname: 'Toronto', code: 'C-TO' }
                ]
            }
        ]
    },
    {
        name: 'United States',
        code: 'US',
        states: [
            {
                name: 'California',
                cities: [
                    { cname: 'Los Angeles', code: 'US-LA' },
                    { cname: 'San Diego', code: 'US-SD' },
                    { cname: 'San Francisco', code: 'US-SF' }
                ]
            },
            {
                name: 'Florida',
                cities: [
                    { cname: 'Jacksonville', code: 'US-JA' },
                    { cname: 'Miami', code: 'US-MI' },
                    { cname: 'Tampa', code: 'US-TA' },
                    { cname: 'Orlando', code: 'US-OR' }
                ]
            },
            {
                name: 'Texas',
                cities: [
                    { cname: 'Austin', code: 'US-AU' },
                    { cname: 'Dallas', code: 'US-DA' },
                    { cname: 'Houston', code: 'US-HO' }
                ]
            }
        ]
    }
]);
</script>

```

When I deploy the flow I see only the hello world (the v-text part) but the primevue features isn't rendered.  
Can someone help me please.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [14 August 2024 08:43 UTC](https://discourse.nodered.org/t/using-primevue-and-other-npm-package-on-dashboard-2-0-ui-template/90123/2 "2024-08-14T08:43:09Z")

</div>

Hi, we don't support the VueJS's Composition API at the moment, only the Options API, nor do we support the use of `import`.

You can see how we load external dependencies here: [Template ui-template | Node-RED Dashboard 2.0](https://dashboard.flowfuse.com/nodes/widgets/ui-template.html#loading-external-dependencies)

Then, to write what you have so far in the Options API, it'd be:

```js
export default {
    data () {
        return {
            selectedCity: null,
            countries:[...]
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 September 2024 08:43 UTC](https://discourse.nodered.org/t/using-primevue-and-other-npm-package-on-dashboard-2-0-ui-template/90123/3 "2024-09-13T08:43:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
