Giter VIP home page Giter VIP logo

Comments (12)

mathlet0x avatar mathlet0x commented on May 14, 2024 1

Sure :)

from bootstrap-vue.

riker09 avatar riker09 commented on May 14, 2024 1

According to the Vue docs multiple types should be possible. I'm preparing a PR. 😃

from bootstrap-vue.

pi0 avatar pi0 commented on May 14, 2024

@samanthaming Thanks. will be fixed soon

from bootstrap-vue.

mathlet0x avatar mathlet0x commented on May 14, 2024

@samanthaming you should try ;) :

<b-form-input v-model="pPrice"
      type="Number"
      label="Product Price"
 />

from bootstrap-vue.

pi0 avatar pi0 commented on May 14, 2024

@mathlet0x Is it safe to close this issue ?

from bootstrap-vue.

riker09 avatar riker09 commented on May 14, 2024

I think the error still exists in v0.6.0. Am I missing something? Here's my code:

<template>
    [...]
    <b-form-input v-model.number="user.balance" type="Number" />
    [...]
</template>

<script>
export default {
  name: 'user-edit',
  props: {
    user: {
      type: Object,
      default: function () {
        return {
          user: {
            name: 'User',
            balance: 123
          }
        }
      }
    }
  }
}
</script>

Just to make it clear: I'm passing a user object shaped like the default object when using this component.

from bootstrap-vue.

riker09 avatar riker09 commented on May 14, 2024

After some more time with Vue.js I think this is because the value passed to the component is actually a Number, but the input field requires a String. In my opinion the component should do the necessary casting itself.

from bootstrap-vue.

pi0 avatar pi0 commented on May 14, 2024

@riker09 Good idea :) I'll make a patch soon

from bootstrap-vue.

riker09 avatar riker09 commented on May 14, 2024

@pi0 Could the formatter be used for this? It should do type safe comparision, though. Currently the formatted value is never used, when, for example the Number 5 is compared to the casted String '5'

from bootstrap-vue.

riker09 avatar riker09 commented on May 14, 2024

Nevermind my last comment. I'm still very new to Vue.js and learning. You've set a prop constraint in the component form-input, that is why I'm seeing this error in the console whenever I pass a Number. 🤦‍♂️

from bootstrap-vue.

pi0 avatar pi0 commented on May 14, 2024

@riker09 So fast reactions :)) Thanks mate

from bootstrap-vue.

riker09 avatar riker09 commented on May 14, 2024

I'm sick at home, so I got a little spare time at my hands. And I'm really diggin Vue.js. Now, when I can help some Open Source projects this really makes my day. 😄

from bootstrap-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.