Tips for transferring a variable value from an input field to the progress property of a vue-circle component

I am currently using vue-circle to showcase a user's skill and the skill level, passing the value through v-modal of an input field to the vue-circle component. However, I am encountering an error when entering a value of 80:

[Vue warn]: Invalid prop: type check failed for prop "progress". Expected Number with value 80, got String with value "80".

This is how I am passing the values:

<vue-circle
      v-for="(skill, index) in skills"
      :key="index"
      :progress= "skill.level"
      :size="130"
      :reverse="false"
      line-cap="round"
      :fill="fill"
      empty-fill="rgba(0, 0, 0, .3)"
      :animation-start-value="0.0"
      :start-angle="0"
      insert-mode="append"
      :thickness="12"
      :show-percent="false"
    >
     <span>{{ skill.skillName }}</span>
</vue-circle>

Here is the input field where the data is entered:

<div class="form-row" v-for="(skill, i) in skills" :key="i">
     <div class="form-group col-md-7">
                <label for="skill">Skill</label>
                <input
                type="text"
                class="form-control"
                id="skill"
                placeholder="Skill"
                v-model.lazy="skill.skillName"
              />
            </div>
            <div class="form-group col-md-5">
              <label for="languageLevel">Level</label>
              <input
                type="text"
                pattern="\d*"
                minlength="2"
                maxlength="3"
                class="form-control"
                id="skillLevel"
                placeholder="Skill Level"
                v-model="skill.level"
              />

Answer №1

Consider utilizing the input type="number" to return a numerical value instead of a string progress, which likely requires a number format. Alternatively, you can employ the parseInt(string, radix) method to convert the value into a number.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is preventing the listener from activating?

I came across some HTML code that looks like this: <form id="robokassa" action="//test.robokassa.ru/Index.aspx" method="post"> <input type="text" id="OutSum" name="OutSum" value="" placeholder="Сумма пополнения"> ...

Utilizing JavaScript within a WordPress loop

I'm facing an issue with running JavaScript within my WordPress loop where it doesn't seem to recognize the PHP variables. My goal is to create a functionality where clicking on one box reveals hidden content, and clicking on the same box or anot ...

Using Lightmaps with Three.js

Is it true that lightmaps function independently of other textures? It seems like I need to establish a second set of UVs. I've exported my JSON object with a second set of UVs and included the following code snippet: geometry.faceVertexUvs[0] = ge ...

Why is it that sailsjs could be failing to acknowledge req.params?

Recently encountered a peculiar bug while working. I'm making a REST PUT call with valid json and an application/json header. The json in the PUT call looks like this: { "gravatarURL": "http://www.gravatar.com/avatar/?d=mm" } Any thoughts o ...

Is there a way to obtain the URL before the page finishes loading, even if the specified waiting time for the webdriver has expired?

Currently, I am attempting to retrieve the URL even if the page is still in the process of loading. However, my goal is to only obtain the URL after a specified wait time of 10 seconds has passed and then trigger a custom exception. I have experimented w ...

HTML5 Embedding a redirect iframe for connection status validation [UPDATE]

I've created an offline HTML file and embedded an iframe within it that redirects to a site if there is an available internet connection. However, in the event of no internet connection, the iframe will redirect to an offline page. Could someone plea ...

Node.js implementation of a remote object for Typeahead functionality

I am facing a significant issue. My goal is to implement Twitter Typeahead autocomplete with node.js. The user should be able to select a name and retrieve all the related data from the database, such as address and email. While attempting to pass an obj ...

Experimenting with JavaScript within an Immediately Invoked Function Expression

My team leader is requesting that I encapsulate my JavaScript code within an Immediately-Invoked Function Expression (IIFE). However, I am struggling to use spyOn in my Jasmine spec file. How can I properly use spyOn on the following: (function(){ fu ...

Ensure to verify the presence of a null value within the ngFor iteration

I have a webpage where I am displaying information in buttons. These buttons show various objects from a list along with their corresponding fields (e.g. object.name, object.age, etc.). Sometimes, one of those fields is null. How can I check if a value is ...

What is the best way to extract values from a TypeORM property decorator?

import { PrimaryColumn, Column } from 'typeorm'; export class LocationStatus { @PrimaryColumn({ name: 'location_id' }) locationId: string; @Column({ name: 'area_code', type: 'int' }) areaCode: number; } I& ...

A step-by-step guide to invoking a function upon submitting a form with an external JavaScript file

How can I execute a function when the user submits a form using an external JavaScript file? index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>example</title> ...

Prevent zooming or controlling the lens in UIWebview while still allowing user selection

Is there a way to disable the zoom/lens on uiwebview without affecting user selection? I'm trying to avoid using "-webkit-user-select:none" in my css. -webkit-user-select:none ...

Encountering an issue when attempting to submit a form using ajax technology

While submitting a post method form, I encountered an issue where the input fields values were not being received upon submission. When using an Ajax call in jQuery to serialize and submit the form values, everything works correctly. However, when attempti ...

What's preventing me from invoking this object's function through an inline anchor?

CSS: <div class="box"> <p>This is a box</p> </div> Javascript: var box = { content : (function() {return ("This is the content of the box")}) }; alert("Box content: \n" + box.content()); $("output").text( +"<br/ ...

Encountered a problem while trying to install using npm install

Encountering an error while running npm install on Ubuntu 12.04: Here is a snippet from my npm-debug.log showing where the errors occur: ... (contents of npm-debug.log) ... This is my package.json: { "name": "www", "version": "0.0.1", /"p ...

Hold off on addressing the nested loops within a TypeScript subscription

Goal: Ensure all nested loops complete processing before returning final value. Problem: Final value returned prematurely, before completion of loop processing. In the code snippet below, I am sending paramListToComplete to a data service for creating a ...

Activate the Sass IntelliSense feature specifically for .vue files within the VS Code editor

Could IntelliSense for Sass be activated in .vue documents without connecting them to sass, as this may disrupt other extensions dependent on the .vue file association? ...

Transforming business entities into JSON format

Currently, I am facing a challenge with serializing my business objects into JSON for use in a JavaScript application. My main concern is maintaining the purity of my business objects by keeping them unaware of data access or persistence. Introducing a toJ ...

Determine the date and time based on the number of days passed

Hey there! I have a dataset structured like this: let events = { "KOTH Airship": ["EVERY 19:00"], "KOTH Castle": ["EVERY 20:00"], Totem: ["EVERY 17:00", "EVERY 23:00"], Jum ...

How can I incorporate dynamic fields into a Typescript type/interface?

In my Typescript interface, I have a predefined set of fields like this: export interface Data { date_created: string; stamp: string; } let myData: Data; But now I need to incorporate "dynamic" fields that can be determined only at runtime. This me ...