diff --git a/.gh-pages/app.js b/.gh-pages/app.js index 529abdf3..224e920b 100644 --- a/.gh-pages/app.js +++ b/.gh-pages/app.js @@ -28,7 +28,7 @@ const CountryItem = { components: { ChannelItem }, - props: ['item', 'query'], + props: ['item', 'normQuery', 'regQuery'], data() { return { count: 0 @@ -36,11 +36,16 @@ const CountryItem = { }, computed: { countryChannels() { - if (!this.query) return this.item.channels + if (!this.normQuery) return this.item.channels return ( this.item.channels.filter(c => { - return c.key.includes(this.query) + const normResult = c.key.includes(this.normQuery) + const regResult = this.regQuery + ? this.regQuery.test(c.name) || this.regQuery.test(c.id) + : false + + return normResult || regResult }) || [] ) } @@ -86,7 +91,7 @@ const CountryItem = { -
+
@@ -116,12 +121,14 @@ const App = { isLoading: true, query: '', normQuery: '', + regQuery: null, items: [] } }, methods: { search() { this.normQuery = this.query.replace(/\s/g, '').toLowerCase() + this.regQuery = new RegExp(this.query) } }, async mounted() { diff --git a/.gh-pages/index.html b/.gh-pages/index.html index 6249ab8b..7c57b516 100644 --- a/.gh-pages/index.html +++ b/.gh-pages/index.html @@ -62,7 +62,7 @@
Loading...
- +