Guest User

Untitled

a guest
Feb 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. template>
  2. <fieldset class="form-group col-md">
  3. <div class="form-check">
  4. <input
  5. class="form-check-input"
  6. type="checkbox"
  7. id="house"
  8. name="house"
  9. v-model="data"
  10. @click="callFunc">
  11. <label
  12. for="house"
  13. class="form-check-label"
  14. >House</label>
  15. </div>
  16. </fieldset>
  17. </template>
  18.  
  19. <script>
  20. module.exports = {
  21. props: {
  22. value: {
  23. type: Boolean,
  24. required: false
  25. }
  26. },
  27. data: function() {
  28. return {
  29. data: false
  30. }
  31. },
  32. created: function() {
  33. if(this.value) {
  34. this.data = this.value;
  35. }
  36. },
  37. methods: {
  38. callFunc: function() { <-- this method is being called correctly
  39. this.$emit('toggleHouse', this.data);
  40. }
  41. }
  42. }
  43. </script>
  44.  
  45. Vue.component('property-house', require('./components/PropertyHouseComponent.vue'));
  46. ...
  47. toggleHouse: function() { <-- this method is being completely ignored
  48. if(value) {
  49. this.csHouse = value;
  50. }
  51. }
  52.  
  53. <property-house :value="true"></property-house>
Add Comment
Please, Sign In to add comment