File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 6767 </ script >
6868
6969 < script >
70- // Vue.component('test-global-cmp', {
71- // template: '<div>Composant de test</div>'
72- // });
7370
74- // var myCmp = {template: '<p>Composant local</p>'};
75- //
7671 Vue . component ( 'todolist' , {
7772 props : [ 'todolist' ] ,
7873 template :'\
@@ -163,7 +158,7 @@ <h3>\
163158 - <i class="fa fa-trash-o" aria-hidden="true" id="show-modal" @click="showModal = true"></i>\
164159 <modal v-if="showModal" @close="showModal = false">\
165160 <h3 slot="header">Confirmer la suppression ?</h3>\
166- <div slot="body">La tache "{{todoItem.name}}" va être definitivement supprimée</div>\
161+ <div slot="body">La tache "{{todoItem.name | shorten }}" va être definitivement supprimée</div>\
167162 <p slot="footer">\
168163 <button class="modal-default-button" @click="showModal = false">\
169164 Annuler\
@@ -183,6 +178,14 @@ <h3 slot="header">Confirmer la suppression ?</h3>\
183178 this . showModal = false ;
184179 this . $emit ( 'deleteItem' ) ;
185180 }
181+ } ,
182+ filters : {
183+ shorten : function ( value ) {
184+ if ( value . length > 10 ) {
185+ return value . slice ( 0 , 7 ) + '...'
186+ }
187+ return value
188+ }
186189 }
187190 } ) ;
188191
You can’t perform that action at this time.
0 commit comments