<route-list/> in Vue application? - javascript

I maintain a web application built on VueJS+Vuetify with some AngularJS. There is a tag in a .vue file I have never seen before and cannot find any documentation on anywhere: <route-list/>
Code:
<route-list v-bind:routes="computedData" />
From what I can tell it binds a list of routes into a side bar navigation based on a computed function.
Is this some kind of depreciated Vue tag? I can't find anything on this tag whatsoever.

Are you sure it is not your own plugin?
Vue.use (<plugin>);
See more details: https://v2.vuejs.org/v2/guide/plugins.html#Using-a-Plugin

Related

Adding scripts in react + server side rendered app

I am trying to follow this integration for Experian QAS service: https://github.com/experianplc/Experian-Address-Validation
It's not really designed for React, so I am trying to find a way to integrate it.
So far, I have downloaded the script file 'experian-address-validation.js' and I have tried to run it by few methods:
Using react-helmet and simply adding
Using component
Creating a script element, adding .src property to it and then appending it to the body
None of these methods work. Also, when looking over 'Sources' tab, I can not find the JS script file, as if it does not exist.

Astro - react useEffect hook is not working

I am trying to build a web app with Astro + Reactjs, but I got an issue on calling useEffect. Basically useEffect is not calling, I don't get any logs in the terminal or any warnings/errors in the terminal or in the browser.
I am exporting the function as: export default function SecondSection(){}, I changed the file extension from .jsx to .tsx, still no result. I followed all instructions from astro docs to integrate react.
I am trying to use react hooks, like useEffect/useState, but for some reasons it's not working any of that.
What can cause that issue? Thank you for your time.
The first thing to check would be to make sure you are hydrating your React component where you’re using it. In Astro, components ship zero JS by default, just plain HTML. Components will only be interactive in the browser if you add a client:* directive. This is part of Astro’s “Islands Architecture”.
To include a component’s JS you need a client directive saying when to load it. In this example the component will load its JS when the page loads:
---
// src/pages/index.astro
import SecondSection from '../components/SecondSection.jsx';
---
<SecondSection client:load />
There are different directives like client:idle or client:visible that you can use to control exactly when a user needs the interactivity. There’s more about the client directives in Astro’s docs.

How do I embed the Calandly widget into an Angular app?

I am trying to embed the Calendly widget into an Angular app and am not quite sure how to accomplish this. Since I will be calling this widget with variable data, I would like to invoke the widget with a user activated function. Based on the documentation and this StackOverflow I have added the following method in my component:
getEventCalender() {
Calendly.initInlineWidget({
url: myVariable.url,
parentElement: document.querySelector('.calendly-inline-widget'),
});
}
and call it with the following (in my .html)
<div>
<button (click)='getEventCalender()'>view cal</button>
</div>
<div class="calendly-inline-widget"></div>
I can see that I need the Calendly.initInlineWidget method supplied by the .js api, however I'm not quite sure how to access it. I have tried downloading the file and importing it into my component, however it didn't work (maybe I did this incorrectly). I suspect this has something to do with the .js file not exporting the method, but not sure where to go from here.
Can anyone provide some direction?
We had a similar issue in our vanilla JS app and found the solution described in their Advanced embed options documentation. We did this by:
Add data-auto-load="false" to the calendly-inline-widget div.
Add parentElement to the initInlineWidget function params.
Extra info: #remy-bartolotta we had the exact split error you described and the above info fixed it.

In which lifecycle method should I place the materialize dropdown menu initializer in Vue js?

As you can see in the materialize docs, using this on a plain html file is quite simple: paste the html somewhere in the body, and paste the js initializer on a script tag. It works fine.
I'm wondering how I can use this on a vue component? I'm talking a .vue file with template, script, style sections.
You could try and call this code in one of Vue's lifecycle hooks (see this diagram to find out where exactly they're executed), you'll probably want to use mounted.
But keep in mind this isn't really a bulletproof solution. Vue may manipulate the DOM in different ways later and as such isn't necessarily compatible with Materialize. The best solution in these cases is always to find a framework-specific implementation of the components you're trying to use, e.g. Vue Material.
I would advice you to include initialize function to mounted() {...} section of a .vue single file component to make sure all HTML tags already exist.

Angular Dart external JS

I am building an Angular-Dart site based on a commercial Bootstrap template.
The correct rendering should be like this:
I used IntelliJ to scaffold a Dart/Angular app and started to modify from there.
I have put related files (CSS/JS/images) of that template into web/css, web/js, respectively.
HTML used is verbatim copied from the template but I have taken out the CSS, JS reference from btqun_component.html and moved into index.html.
The output is like this:
Obviously, the CSS is working, and the header/footer are showing correctly. But the masonry effect is not showing, so I doubt that is related to JS reference.
Can anyone give any hints on this?
Do you have a documentation for the bootstrap template ? I guess you need to execute the javascript they provide to you so you need to add it to your index.html, and you probably need to import bootstrap and jquery too.
If you need to call a javascript function you can do it directly in the index.html inside a script tag or build a dart wrapper using package:js
EDIT: answer to call jQuery function from Dart

Categories