在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ HTML問答
胭脂淚 回答

===的問題吧,你的hotOrNot是number類型吧,0和1是string,===還要類型一樣的,所以不顯示,hotOrNot===0,0和1不加引號(hào)試試

掛念你 回答

我們公司的老項(xiàng)目 也是用的 AngularJS
每個(gè)模塊加載對(duì)應(yīng)的js和css
我們使用的是Angular的第三方路由:ui-router
或者使用oclazyload也可以
參考:
https://www.cnblogs.com/pengj...
https://www.cnblogs.com/jonne...

有你在 回答

main.js

import jquery from 'jquery'

window.jquery = window.$ = jquery
冷溫柔 回答

你的webpack是項(xiàng)目本地安裝的么?全局安裝了么?

IOS處理

// 處理撥打電話以及Url跳轉(zhuǎn)等等  
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {  
    NSURL *URL = navigationAction.request.URL;  
    NSString *scheme = [URL scheme];  
    if ([scheme isEqualToString:@"tel"]) {  
        NSString *resourceSpecifier = [URL resourceSpecifier];  
        NSString *callPhone = [NSString stringWithFormat:@"telprompt://%@", resourceSpecifier];  
        /// 防止iOS 10及其之后,撥打電話系統(tǒng)彈出框延遲出現(xiàn)  
        dispatch_async(dispatch_get_global_queue(0, 0), ^{  
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:callPhone]];  
        });  
    }  
    decisionHandler(WKNavigationActionPolicyAllow);  
}

任她鬧 回答

上面是公眾號(hào)的
下面是微信小程序的

下墜 回答

并不建議把請(qǐng)求封裝在分頁組件里面,各大主流UI框架都有現(xiàn)成的分頁組件了,向后端請(qǐng)求無非就是用到分頁組件的當(dāng)前請(qǐng)求頁current-page及每頁請(qǐng)求條目個(gè)數(shù) page-size ,頁面監(jiān)聽到組件這2個(gè)屬性變更就重新提交請(qǐng)求,邏輯很清晰。
你要是把請(qǐng)求封裝在分頁組件里面,要把請(qǐng)求方法當(dāng)參數(shù)傳進(jìn)去吧,組件還得能接受請(qǐng)求額外參數(shù)吧,要提供手動(dòng)請(qǐng)求接口吧,請(qǐng)求回調(diào)后又要從分頁組件里面拿回調(diào)吧?這個(gè)可以實(shí)現(xiàn),但總感覺邏輯不對(duì)


element-ui為例 截取一段我的實(shí)現(xiàn)方法

<el-pagination
    @size-change="tableSizeChange"
    @current-change="tablePageChange"
    :current-page="table.page"
    :page-sizes="table.pageSizes"
    :page-size="table.pageSize"
    :total="table.total"
    layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
data() {
  return {
    search:{                                //檢索關(guān)聯(lián)
      status: 'ALL',
      create_time: [start, end],
      seller_flag: -1,
      buyer_remark: 0,
      seller_remark: 0,
      address_code: '',
      keyword_trade: '',
      keyword_sku: '',
      keyword_address: ''
    },
    table: {
      pageSize: 20,                         //默認(rèn)每頁數(shù)據(jù)量
      pageSizes: [20, 30, 50, 100],         //可選的分頁數(shù)據(jù)量
      page: 1,                              //當(dāng)前頁碼
      total: 0,                             //分頁總數(shù)據(jù)量 后端提供
      sort: {},                             //排序數(shù)據(jù)
    },
  }
},
methods: {
  tableSizeChange(size) {
    this.table.pageSize = size;
    this.onSearchSubmit()
  },
  tablePageChange(page) {
    this.table.page = page;
    this.onSearchSubmit()
  },
  onSearchSubmit() {
    this.loading = true;
    this.$store.dispatch('tradeSearch', {
      ...this.search,
      page: this.table.page,
      page_size: this.table.pageSize,
      callback: res => {
        this.loading = false;
        if (!res.code) {
          if (res.data.page === 1) {
             this.table.total = res.data.total
          }
          this.list = res.data.list.map(({id}) => id);
        } else {
          this.list = [];
        }
      }
    });
  },
尕筱澄 回答

我也發(fā)現(xiàn)相同的問題,不知道是不是NPM網(wǎng)站的問題

初念 回答
但我把mounted改成created的時(shí)候會(huì)報(bào)Cannot read property 'appendChild' of null"

這是因?yàn)閏reated的時(shí)候,Dom節(jié)點(diǎn)還沒有渲染出來到頁面上,這個(gè)時(shí)候是找不到id=wave的DIV的。


改成Vue的插件

import wavePng from './wave.png'
export default {
    install(Vue){
        Vue.directive('wave', {
            inserted: function(el){
                start(el)
            }
        })
    }
}
    var ctx;
    var waveImage;
    var canvasWidth;
    var canvasHeight;
    var needAnimate = false;

    function init (callback, wave) {
        // var wave = document.getElementById('wave');
        var canvas = document.createElement('canvas');
        if (!canvas.getContext) return;
        ctx = canvas.getContext('2d');
        canvasWidth = wave.offsetWidth;
        canvasHeight = wave.offsetHeight;
        canvas.setAttribute('width', canvasWidth);
        canvas.setAttribute('height', canvasHeight);
        wave.appendChild(canvas);
        waveImage = new Image();
        waveImage.onload = function () {
            console.log('000')
            waveImage.onload = null;
            callback(wave);
        }
        waveImage.src = wavePng;
    }

    function animate () {
        var waveX = 0;
        var waveY = 0;
        var waveX_min = -203;
        var waveY_max = canvasHeight * 0.7;
        var requestAnimationFrame = 
            window.requestAnimationFrame || 
            window.mozRequestAnimationFrame || 
            window.webkitRequestAnimationFrame || 
            window.msRequestAnimationFrame ||
            function (callback) { window.setTimeout(callback, 1000 / 60); };
        function loop () {
            ctx.clearRect(0, 0, canvasWidth, canvasHeight);
            if (!needAnimate) return;
            if (waveY < waveY_max) waveY += 1.5;
            if (waveX < waveX_min) waveX = 0; else waveX -= 3;
            
            ctx.globalCompositeOperation = 'source-over';
            ctx.beginPath();
            ctx.arc(canvasWidth/2, canvasHeight/2, canvasHeight/2, 0, Math.PI*2, true);
            ctx.closePath();
            ctx.fill();

            ctx.globalCompositeOperation = 'source-in';
            ctx.drawImage(waveImage, waveX, canvasHeight - waveY);
            
            requestAnimationFrame(loop);
        }
        loop();
    }

    function start (el) {
        console.log(1)
        if (!ctx) return init(start, el);
        needAnimate = true;
        setTimeout(function () {
            if (needAnimate) animate();
        }, 500);
    }
    function stop () {
        needAnimate = false;
    }

上述的代碼,把原先插件的閉包去掉了,因?yàn)檫@個(gè)改成vue的插件webpack打包完本身就是一個(gè)閉包了。
然后使用的話,就用指令的形式

<template>
  <div id="wave" class="wave" v-wave><span>60%</span></div>
</template>

<script>
import wave from './a'
export default {

}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.wave{width:200px;height:200px;overflow:hidden;border-radius:50%;background:rgba(255,203,103,.6);margin:100px auto;position:relative;text-align:center;display:table-cell;vertical-align:middle;}
.wave span{display:inline-block;color:#fff;font-size:20px;position:relative;z-index:2;}
.wave canvas{position:absolute;left:0;top:0;z-index:1;}
</style>

main.js

import Vue from 'vue'
import App from './App'
import router from './router'
import wave from './components/a'

Vue.config.productionTip = false
Vue.use(wave)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})

這樣就可以了。

萌二代 回答

每一個(gè)白框都設(shè)置成一個(gè)單獨(dú)的flex布局試試

陪我終 回答
  1. params是GET參數(shù),你看看你發(fā)出去的請(qǐng)求鏈接,這里可能會(huì)導(dǎo)致后端解析錯(cuò)誤
  2. reject的時(shí)候,把error打印出來
離夢(mèng) 回答
var的for循環(huán)我明白

不,你不明白

你的代碼相當(dāng)于:

var testVar,i;
for(i=0;i<3;i++){
    testVar=function(){
    console.log(i)
    };
}
testVar();

那么你告訴我,為什么不是3?跟閉包一點(diǎn)關(guān)系沒有,僅僅因?yàn)?code>i 是全局變量,等你testVar()i已經(jīng)變成了3.

ES6 let 的代碼相當(dāng)于

let testVar;
for(let i=0;i<3;i++){
    let k=i;
    testVar=function(){
      console.log(k)
    };
}
testVar(); 

i=3的時(shí)候,根本不會(huì)執(zhí)行{}里的代碼,所以當(dāng)然是 2,而且這里的i,k都處于塊級(jí)作用域,{}之外根本無法訪問。與var是有完全區(qū)別的。

es5 沒掌握好不建議學(xué)es6,先鞏固下var的變量提升和閉包吧,es5 沒有塊級(jí)作用域在學(xué) ES6 之前就應(yīng)該知道的。

枕頭人 回答

你是用的python2還是python3創(chuàng)建的Virtualenv,python3的話你看看你全局的pip3是什么版本,估計(jì)還是9的

亮瞎她 回答
  1. subClass();在全局環(huán)境下執(zhí)行,里面的this指向window;
  2. superClass.call(this)這里將window傳入函數(shù),里面的this也是指向window;
  3. 代碼執(zhí)行后相當(dāng)于
window.c =222;
window.c =333;
window.d ='bbb';
window.d ='aaa';

console.log(window.c);//333
console.log(window.d);//aaa

異常貼全一點(diǎn),NoClassDefFoundError 異常一般是少包或者包沖突。

你的第二個(gè)文件和第一文件路徑一樣么?我估計(jì)你是把緩存里的文件打開了。

有你在 回答

第一步,通過theme,修改整體風(fēng)格,官方文檔有詳細(xì)描述。
第二步,將不符合要求的地方通過重寫樣式搞定。

心悲涼 回答

https://github.com/ReactTrain...

直接使用history的方法history.listen()在切換路由的時(shí)候就會(huì)自動(dòng)觸發(fā)

import createHistory from "history/createBrowserHistory"

const history = createHistory()

// Get the current location.
const location = history.location

// Listen for changes to the current location.
const unlisten = history.listen((location, action) => {
  // location is an object like window.location
  console.log(action, location.pathname, location.state)
})

// Use push, replace, and go to navigate around.
history.push("/home", { some: "state" })

// To stop listening, call the function returned from listen().
unlisten()