Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template>
- <fieldset class="form-group col-md">
- <div class="form-check">
- <input
- class="form-check-input"
- type="checkbox"
- id="house"
- name="house"
- v-model="data"
- @click="callFunc">
- <label
- for="house"
- class="form-check-label"
- >House</label>
- </div>
- </fieldset>
- </template>
- <script>
- module.exports = {
- props: {
- value: {
- type: Boolean,
- required: false
- }
- },
- data: function() {
- return {
- data: false
- }
- },
- created: function() {
- if(this.value) {
- this.data = this.value;
- }
- },
- methods: {
- callFunc: function() { <-- this method is being called correctly
- this.$emit('toggleHouse', this.data);
- }
- }
- }
- </script>
- Vue.component('property-house', require('./components/PropertyHouseComponent.vue'));
- ...
- toggleHouse: function() { <-- this method is being completely ignored
- if(value) {
- this.csHouse = value;
- }
- }
- <property-house :value="true"></property-house>
Add Comment
Please, Sign In to add comment