Browse Source

Fixed search escape bug (#4815)

文翼 5 years ago
parent
commit
8ce7304025
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/bootstrap-table.js

+ 2 - 2
src/bootstrap-table.js

@@ -185,7 +185,7 @@ class BootstrapTable {
     // if options.data is setting, do not process tbody and tfoot data
     if (!this.options.data.length) {
       this.options.data = Utils.trToData(this.columns, this.$el.find('>tbody>tr'))
-      if (data.length) {
+      if (this.options.data.length) {
         this.fromHtml = true
       }
     }
@@ -766,7 +766,7 @@ class BootstrapTable {
         return
       }
 
-      const s = this.searchText && (this.options.escape
+      const s = this.searchText && (this.fromHtml
         ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase()
       const f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns