diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js
index 01ae133..8eb9589 100644
--- a/build/webpack.prod.conf.js
+++ b/build/webpack.prod.conf.js
@@ -53,8 +53,13 @@ const webpackConfig = merge(baseWebpackConfig, {
new UglifyJsPlugin({
uglifyOptions: {
compress: {
- warnings: false
- }
+ warnings: false,
+ drop_console: true, // 移除console
+ pure_funcs: ['console.log','console.info'] // 移除console.log
+ },
+ output: {
+ comments: true // 移除所有注释
+ }
},
sourceMap: config.build.productionSourceMap,
parallel: true
diff --git a/src/views/contract/index.vue b/src/views/contract/index.vue
index 653c1e4..881bfa0 100644
--- a/src/views/contract/index.vue
+++ b/src/views/contract/index.vue
@@ -95,7 +95,7 @@
:key="item.symbol"
:class="{ active: item.symbol == activeSymbol }"
@click="ispopover1(item.symbol)"
- v-show="isShow(item)"
+ v-if="isShow(item)"
style="display:block"
>
@@ -370,10 +370,11 @@ export default {
if (sub == msg) {
if( data.symbol=='BTC' )(data.price).toFixed(1)
this.contractList = data;
- // if(this.filterCoin==''){
- // this.contractListFilter = data;
- // // this.Listes();
- // }
+ if(this.filterCoin==''){
+ // console.log('123');
+ this.contractListFilter = data;
+ // this.Listes();
+ }
}else if (cmd == "ping") {
this.ws.send({
cmd: "pong"
@@ -409,11 +410,12 @@ export default {
if(this.activeSymbol==''){
// 页面初始获取
this.contractList = res;
- this.Listes();
- // if(this.filterCoin==''){
- // this.contractListFilter = res;
- // this.Listes();
- // }
+ // this.Listes();
+ if(this.filterCoin==''){
+ // console.log('1234');
+ this.contractListFilter = res;
+ this.Listes();
+ }
// 默认值
let firstParent = res[0];
@@ -482,16 +484,19 @@ export default {
},
isShow(symbol) {
-
- const reg = new RegExp(this.filterCoin, "gi");
- if (!this.filterCoin) return true;
- else {
- // let name = symbol.coinName || symbol.pair;
- // return name.search(reg) >= 0;
- let name = symbol.pair_name || symbol.symbol;
- return reg.test(name);
- // return name.search(reg) >= 0;
- }
+ if (!this.filterCoin) return true;
+ let name = symbol.pair_name || symbol.symbol;
+ return name.toLowerCase().includes(this.filterCoin.toLowerCase());
+ // const reg = new RegExp(this.filterCoin, "gi");
+ // if (!this.filterCoin) return true;
+ // else {
+ // // let name = symbol.coinName || symbol.pair;
+ // // return name.search(reg) >= 0;
+ // let name = symbol.pair_name || symbol.symbol;
+ // console.log(reg.test(name),'12345');
+ // return reg.test(name);
+ // // return name.search(reg) >= 0;
+ // }
// return !this.keyword || symbol.coinName.concat(symbol.pair).search(reg) >= 0;
},
|