Hi everyone,
After my first experience with the dashboard I'm ready to move forward to the next level. So my eye dropped on the uibuilder. To be honest I already looked at it long time ago, but since I wasn't familiar at that time with node-red and dashboard itself I was quickly overwelmed by it's complexity (at least that how it looked to me at that time )
The goal is to have a home dashboard in the end.
So last week I dove into it. To start simple I just created my index page which shows data from a weatherstation I made based on ESP8266 and a BME280 sensor. The ESP8266 sends data to my MQTT.
What I got working so far with uibuilder:
- Can read messages from my mqtt server and have them displayed.
- Based upon payload from one of the messages: make an icon switch between battery charging or not (as the weatherstation is powered by a solar panel)
- Have the Toast example working with (at the moment) a simple inject node in my flow.
The reason for posting here is that I can not get to work the navigation I would like to implement which you can find here: https://github.com/imanmalekian31/vue-bottom-navigation
I tried following this guide: https://github.com/TotallyInformation/node-red-contrib-uibuilder/wiki/Load-Vue-components-without-a-build-step-(modern-browsers-only) but to no avail.
I have installed the front-end library from node-red interface.
In my home folder I have .node-red/node_modules/bottom-navigation-vue/....
I added:
<VueBottomNavigation :options="options" v-model="selected" />
in my index.html. Also in the following form
<VueBottomNavigation :options="options" v-model="selected"></VueBottomNavigation>
as the console complains about the "trailing solidus"
Then added in my index.js:
var vueTST = new Vue({
el: '#vueTST',
components: { VueBottomNavigation },
data: {
batStatus: 0,
selected: 1,
options: [
{
id: 1,
icon: "fas fa-home",
title: "Home",
childs: [
{ id: 101, icon: "fas fa-tshirt", title: "Products" },
{ id: 102, icon: "fas fa-tag", title: "Discount" },
{ id: 103, icon: "fas fa-gifts", title: "Gifts", badge: 7 },
],
},
{ id: 2, icon: "fas fa-wallet", title: "Wallet" },
{
id: 3,
icon: "fas fa-plus",
title: "Setting",
childs: [
{ id: 301, icon: "fas fa-bookmark", title: "Bookmarks" },
{ id: 302, icon: "fas fa-tasks", title: "Tasks" },
{ id: 303, icon: "fas fa-tachometer-alt", title: "Dashboard" },
{ id: 304, icon: "fas fa-ticket-alt", title: "Tickets" },
],
},
{ id: 4, icon: "fas fa-bell", title: "Notification", badge: 15 },
{ id: 5, icon: "fas fa-user", title: "Account" },
],
},
Then the console complains about:
**Uncaught ReferenceError: VueBottomNavigation is not defined**
So I add:
import VueBottomNavigation from "bottom-navigation-vue";
above the var vueTST
from the previous snippet, but then I get:
Uncaught TypeError: Failed to resolve module specifier "bottom-navigation-vue". Relative references must start with either "/", "./", or "../".
I tried almost every path in front of "bottom-navigation-vue" (aka uibuilder/vendor/.. and such) but no success either (404 not found)
So then I followed the Wiki I referenced earlier with a separate .js but I got same error in the end. So I'm running in circles here. I'm quiet sure the problem has something to do with accessing the module but I can't get my head around the way it's supposed to work.
Can someone shed a light on what I'm missing?
Sorry for the long post but I wanted to be as complete as possible.
regards,
pom
EDIT:
I would like to add the path ../uibuilder/vendor/bottom-navigation-vue resolves (so no 404) but I have no clue to what I need to point the code (I tried every .js and .vue file but no luck). These are the contents:
$ tree
โโโ babel.config.js
โโโ LICENSE
โโโ package.json
โโโ public
โ โโโ favicon.ico
โ โโโ index.html
โโโ README.md
โโโ src
โ โโโ App.vue
โ โโโ assets
โ โ โโโ github-logo.png
โ โ โโโ logo.png
โ โโโ components
โ โ โโโ BottomNavigation.vue
โ โโโ install.js
โ โโโ main.js
โโโ vue.config.js