This repository was archived by the owner on May 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 107107<style scoped lang="scss" src="../../../sass/modules/global-search.scss "></style >
108108
109109<script >
110+ import Fuse from ' fuse.js'
110111import debounce from ' lodash/debounce'
111- import VueInputAutowidth from ' vue-input-autowidth'
112112import panels from ' ../../mixins/panels'
113+ import VueInputAutowidth from ' vue-input-autowidth'
113114
114115export default {
115116 components: {
116117 imageIntersect: require (' ./image.vue' ).default
117118 },
118- directives: {
119- VueInputAutowidth
120- },
121- mixins : [panels],
122- props : [
119+ props: [
123120 ' trans' ,
124121 ' fileTypeIs' ,
125122 ' noScroll' ,
126123 ' browserSupport' ,
127124 ' addToMovableList' ,
128125 ' inMovableList'
129126 ],
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],
130136 data () {
131137 return {
132138 filesIndex : [],
@@ -166,6 +172,8 @@ export default {
166172 EventHub .listen (' global-search-deleted' , (path ) => {
167173 let list = this .filterdFilesList
168174
175+ console .log (list)
176+
169177 return list .some ((e , i ) => {
170178 if (e .path == path) {
171179 list .splice (i, 1 )
@@ -199,6 +207,10 @@ export default {
199207 if (search) {
200208 this .filterdFilesList = this .fuseLib .search (search)
201209
210+ this .filterdFilesList = this .filterdFilesList .map ((e ) => {
211+ return e .item
212+ })
213+
202214 return this .noData = this .listCount ? false : true
203215 }
204216
Original file line number Diff line number Diff line change @@ -66,7 +66,11 @@ export default {
6666 } ,
6767 fileTypeIs ( item , val ) {
6868 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
7074
7175 if ( type ) {
7276 if ( val == 'image' && mimes . image . includes ( type ) ) {
You can’t perform that action at this time.
0 commit comments