File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
resources/js/components/blueprints Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1919 <button @click.prevent =" toggleEditing" class =" text-grey-60 hover:text-grey-100 mr-1" >
2020 <svg-icon :name =" isEditing ? 'shrink' : 'expand'" />
2121 </button >
22- <button @click.prevent =" $emit('deleted')" class =" text-grey-60 hover:text-grey-100" >
22+ <button @click.prevent =" $emit('deleted')" class =" text-grey-60 hover:text-grey-100" v-if = " deletable " >
2323 <svg-icon name =" trash" />
2424 </button >
2525 </div >
@@ -69,6 +69,10 @@ export default {
6969 isSingle: {
7070 type: Boolean ,
7171 default: false
72+ },
73+ deletable: {
74+ type: Boolean ,
75+ default: true
7276 }
7377 },
7478
Original file line number Diff line number Diff line change 1010 :key =" section._id"
1111 :section =" section"
1212 :is-single =" singleSection"
13+ :deletable =" isSectionDeletable(i)"
1314 @updated =" updateSection(i, $event)"
1415 @deleted =" deleteSection(i)"
1516 />
@@ -181,6 +182,14 @@ export default {
181182 if (this .requireSection && this .sections .length === 0 ) {
182183 this .addSection ();
183184 }
185+ },
186+
187+ isSectionDeletable (i ) {
188+ if (this .sections .length > 1 ) return true ;
189+
190+ if (i > 0 ) return true ;
191+
192+ return ! this .requireSection ;
184193 }
185194
186195 }
You can’t perform that action at this time.
0 commit comments