Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <template>
  2. <div id="app">
  3. <label for="quantify">Cantidad Solicitada:</label>
  4. <input type="number" v-model="quantify" class="form-control">
  5. <label for="plazo">Plazo Quincenal:</label>
  6. <select @change="onSelectOption($event)" class="form-control">
  7. <option value="" disabled selected hidden>Seleccionar una Opción</option>
  8. <option v-for="i in 12" :value="i">
  9. {{i}}
  10. </option>
  11. </select>
  12. <br/>
  13. <h3><span>Por tu prestamo pagarías la cantidad quincenal de: <b class="text-success">$ {{ total }} </b></span></h3>
  14. </div>
  15. </template>
  16.  
  17. /**
  18. * First we will load all of this project's JavaScript dependencies which
  19. * includes Vue and other libraries. It is a great starting point when
  20. * building robust, powerful web applications using Vue and Laravel.
  21. */
  22.  
  23. require('./bootstrap');
  24.  
  25. window.Vue = require('vue');
  26.  
  27. /**
  28. * The following block of code may be used to automatically register your
  29. * Vue components. It will recursively scan this directory for the Vue
  30. * components and automatically register them with their "basename".
  31. *
  32. * Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
  33. */
  34.  
  35. // const files = require.context('./', true, /.vue$/i);
  36. // files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));
  37.  
  38. Vue.component('calculadora-component', require('./components/calculadora.vue').default);
  39. /**
  40. * Next, we will create a fresh Vue application instance and attach it to
  41. * the page. Then, you may begin adding components to this application
  42. * or customize the JavaScript scaffolding to fit your unique needs.
  43. */
  44.  
  45. const app = new Vue({
  46. el: "#app",
  47. data: {
  48. quantify: 0,
  49. total: 0
  50. },
  51. methods: {
  52. onSelectOption(event) {
  53. this.total = (this.quantify * ((event.target.value * 0.05) + 1))/event.target.value
  54. }
  55. }
  56. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement