Commit 831caac 1 parent eec2df6 commit 831caac Copy full SHA for 831caac
File tree 2 files changed +23
-7
lines changed
2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 107
107
<style scoped lang="scss" src="../../../sass/modules/global-search.scss "></style >
108
108
109
109
<script >
110
+ import Fuse from ' fuse.js'
110
111
import debounce from ' lodash/debounce'
111
- import VueInputAutowidth from ' vue-input-autowidth'
112
112
import panels from ' ../../mixins/panels'
113
+ import VueInputAutowidth from ' vue-input-autowidth'
113
114
114
115
export default {
115
116
components: {
116
117
imageIntersect: require (' ./image.vue' ).default
117
118
},
118
- directives: {
119
- VueInputAutowidth
120
- },
121
- mixins : [panels],
122
- props : [
119
+ props: [
123
120
' trans' ,
124
121
' fileTypeIs' ,
125
122
' noScroll' ,
126
123
' browserSupport' ,
127
124
' addToMovableList' ,
128
125
' inMovableList'
129
126
],
127
+ directives: {
128
+ autowidth: {
129
+ beforeMount : VueInputAutowidth .bind ,
130
+ mounted : VueInputAutowidth .inserted ,
131
+ updated : VueInputAutowidth .componentUpdated ,
132
+ unmounted : VueInputAutowidth .unbind
133
+ }
134
+ },
135
+ mixins: [panels],
130
136
data () {
131
137
return {
132
138
filesIndex : [],
@@ -166,6 +172,8 @@ export default {
166
172
EventHub .listen (' global-search-deleted' , (path ) => {
167
173
let list = this .filterdFilesList
168
174
175
+ console .log (list)
176
+
169
177
return list .some ((e , i ) => {
170
178
if (e .path == path) {
171
179
list .splice (i, 1 )
@@ -199,6 +207,10 @@ export default {
199
207
if (search) {
200
208
this .filterdFilesList = this .fuseLib .search (search)
201
209
210
+ this .filterdFilesList = this .filterdFilesList .map ((e ) => {
211
+ return e .item
212
+ })
213
+
202
214
return this .noData = this .listCount ? false : true
203
215
}
204
216
Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ export default {
66
66
} ,
67
67
fileTypeIs ( item , val ) {
68
68
let mimes = this . config . mimeTypes
69
- let type = item . type || item
69
+ let type = item . hasOwnProperty ( 'type' )
70
+ ? item . type
71
+ : item . hasOwnProperty ( 'item' )
72
+ ? item . item . type
73
+ : item
70
74
71
75
if ( type ) {
72
76
if ( val == 'image' && mimes . image . includes ( type ) ) {
You can’t perform that action at this time.
0 commit comments