how to import js file correctly in vue

i import js-cloudimage-360-view(https://github.com/scaleflex/js-cloudimage-360-view) into index.html, but the code in vue template didn’t render successful and display nothing, chrome console didn’t report any error. And in my test, when the code paste in index.html it’s worked, but in myComponent.vue failed. How to import js-cloudimage-360-view.min.js fully functional import js in index.html <div id="app"></div> <!– built files will… Read More how to import js file correctly in vue

How can I change each number's background color?

I am dealing with a simple project but have a problem: <script setup> import { ref } from "vue"; const isActive = ref(false); const rates = ref([1, 2, 3, 4, 5]); const selectPick = () => { isActive.value = !isActive.value; }; </script> <template> <main> <div v-show="!isVisible" class="card-container"> <div class="content-container"> … <ul> <li v-for="rate in rates"… Read More How can I change each number's background color?

Can't access items of a JSON array with vue.js

I have JSON data like this : { "kind": "books#volumes", "totalItems": 3436, "items": [ { "kind": "books#volume", "id": "yMtVngEACAAJ", "etag": "lo1fkwDSvPU", "selfLink": "https://www.googleapis.com/books/v1/volumes/yMtVngEACAAJ&quot;, "volumeInfo": { "title": "We Are in a Book! (An Elephant and Piggie Book)", "publisher": "Hyperion", "publishedDate": "2010-09-14", … I get it from a google’s API with this function : const getBookData =… Read More Can't access items of a JSON array with vue.js

How to pass an integer variable as an array index in Vue.js 3?

I’ve struggled with an issue that seems really silly, but I could not find a solution for it. The following variable declaration works: export default { data() { return { random_number: 1, random_array: [‘A’,’B’,’C’], } } However, if I try to declare a third variable that accesses random_array, as in the two examples below, it… Read More How to pass an integer variable as an array index in Vue.js 3?

Vue Bootstrap – How to use double quotes in v-b-tooltip

I am using this vue bootstrap tooltip. https://bootstrap-vue.org/docs/directives/tooltip Now, I have this tooltip: <label>Encoding <feather-icon icon="AlertCircleIcon" class="mr-50 my-icon" v-b-tooltip.hover.right="’The encoding used inside the feed. Leave Automatically if you are uncertain’" /> </label> On this toolitp text, I want to add double quotes around this word Automatically If I use double quotes Its not render. Can… Read More Vue Bootstrap – How to use double quotes in v-b-tooltip

how to asynchronously fetch the data from api using vue to form a table?

My html <div id="app"> <table> <thead> <tr> <th v-for="(header, key) in column" :key="key">{{ header }}</th> </tr> </thead> <tbody> <tr v-for="row in rows" :key="row.id"> <td>{{ row.id }}</td> <td>{{ row.name }}</td> <td>{{ row.phone }}</td> </tr> </tbody> </table> </div> I’m trying to write a function in js and hook it up to my vue instance to fetch the… Read More how to asynchronously fetch the data from api using vue to form a table?