Skip to content

Commit

Permalink
[Issue 11] Nova hideWhenCreating() not working
Browse files Browse the repository at this point in the history
  • Loading branch information
kongulov committed Jul 3, 2021
1 parent 0ef0bfc commit c20354c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion resources/js/components/FormField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
<div class="tab-contents">
<div class="tab-content" v-for="(component, index) in field.fields"
v-show="selectedLang === component.locale">
v-show="selectedLang === component.locale && checkVisibility(component)">
<component
:key="index"
:class="{'remove-bottom-border ': (index + 1) % field.originalFieldsCount !== 0}"
Expand Down Expand Up @@ -44,12 +44,23 @@ export default {
mounted() {
this.selectedLang = this.field.languages[0] ? this.field.languages[0] : '';
},
created(){
console.log(this.field.fields[0]);
console.log('resourceId: ' + this.resourceId);
},
watch:{
errors() {
this.switchToErrorTab();
}
},
methods: {
isCreatePage(){
return this.resourceId === undefined;
},
checkVisibility(component){
if (this.isCreatePage()) return component.showOnCreation;
else return component.showOnUpdate;
},
setInitialValue() {
this.value = this.field.value || ''
},
Expand Down

0 comments on commit c20354c

Please sign in to comment.