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

鍍金池/ 問(wèn)答/ HTML問(wèn)答
半心人 回答

為什么不用button元素?
button元素可以用onclick屬性啊。

敢試 回答

v-show當(dāng)頁(yè)面進(jìn)來(lái)時(shí)就渲染了 只不過(guò)是用css display:none屬性隱藏掉了,當(dāng)然不會(huì)刷新了。
建議你去看看 v-if和v-show的區(qū)別

膽怯 回答

{

  path: '*',
  redirect: '/recommend'

},

焚音 回答

樓主,如果你已經(jīng)排好序的話,是不是要這個(gè)效果:

var newDataArray = dataList.reduce((target,current)=>{
    if(target[target.length-1] == null || target[target.length-1][target[target.length-1].length - 1].categoryName !== current.categoryName) {
        target.push([current])
    } else {
        target[target.length-1].push(current)
    }
    return target

}, []);

console.log(newDataArray)
失心人 回答

沒有css-loader你可以單獨(dú)安裝,這種問(wèn)題應(yīng)該是不同依賴環(huán)境造成的。

或者簡(jiǎn)單粗暴,把node卸載了,裝你同事那個(gè)版本

冷咖啡 回答
  1. debouncethrottle是目前用得最廣泛的,具體可見樓上的一堆收藏;
  2. 想要確保邏輯上不會(huì)有同時(shí)提交的請(qǐng)求,npm搜“mutex”也有很多;
  3. 或者我也寫了一個(gè)簡(jiǎn)易版的,用下面的函數(shù)包裹點(diǎn)擊回調(diào),如果前一次請(qǐng)求尚未結(jié)束,新請(qǐng)求會(huì)和舊請(qǐng)求一起返回。這樣的話回調(diào)要返回Promise

    const debounceAsync = originalFunction => {
      let currentExcution = null;
      const wrappedFunction = async function () {
        // 1. locked => return lock
        if (currentExcution) return currentExcution;
    
        // 2. released => apply
        currentExcution = originalFunction.apply(this, arguments);
        try {
          return await currentExcution;
        }
        finally {
          currentExcution = null;
        }
      };
      return wrappedFunction;
    };

    用法

    const sleep = (ms = 0) => new Promise(resolve => setTimeout(resolve, ms));
    
    const debounceAsync_UNIT_TEST = async () => {
      const goodnight = debounceAsync(sleep);
      for (let i = 0; i < 8; i++) {
        goodnight(5000).then(() => console.log(Date()));
        await sleep(500);
      }
      console.warn('Expected output: 8 identical datetime');
    };

    https://segmentfault.com/a/11...

念舊 回答

看人家返回給你的是什么內(nèi)容了,如果是blob,這樣

jsFileDownload (filename, data, mime) {
    let blob = new Blob([data], {type: mime || 'application/octet-stream'})
    if (typeof window.navigator.msSaveBlob !== 'undefined') {
      window.navigator.msSaveBlob(blob, filename)
    } else {
      var blobURL = window.URL.createObjectURL(blob)
      var tempLink = document.createElement('a')
      tempLink.style.display = 'none'
      tempLink.href = blobURL
      tempLink.setAttribute('download', filename)
      if (typeof tempLink.download === 'undefined') {
        tempLink.setAttribute('target', '_blank')
      }
      document.body.appendChild(tempLink)
      tempLink.click()
      document.body.removeChild(tempLink)
      window.URL.revokeObjectURL(blobURL)
    }
  }

如果是url,那就很簡(jiǎn)單了,沒必要我寫了

未命名 回答

1.給對(duì)話框元素添加一個(gè)屬性isEdit,點(diǎn)擊添加按鈕的時(shí)候給這個(gè)屬性設(shè)置為false,點(diǎn)擊編輯的時(shí)候給這個(gè)屬性設(shè)置為true,在保存的時(shí)候獲取這個(gè)屬性判斷
2.當(dāng)然也可以把isEdit存為全局變量

尕筱澄 回答

你這個(gè)壓縮圖片有問(wèn)題
this.compress(vm.temp.base64Img);傳入的是base64格式的字符串
canvas.width = img.width; canvas.height = img.height;這里base64格式的字符串是獲取不到寬高的
這句canvas.toDataURL("image/jpeg", 0.15)你之前沒有把圖片畫到canvas上所以的canvas上是空的

callback:

compress(base64img,callback) {
    var img = new Image();
    img.src = base64img;
    img.onload = function(){
        var width = img.width;
        var height = img.height;
        var canvas = document.createElement("canvas");
        canvas.width = width;
        canvas.height = height;
        canvas.getContext("2d").drawImage(img,0,0,width,height);
        callback(canvas.toDataURL("image/jpeg", 0.15))
    }
}
//調(diào)用
vm.compress(vm.temp.base64img, function (base64img) {
    uploadImage({ base64img }).then(response => {
        const data = response.data;
        //...
    });
});

promise:

function compress(base64img, callback) {
    return new Promise(function (resolve) {
        var img = new Image();
        img.src = base64img;
        img.onload = function () {
            var width = img.width;
            var height = img.height;
            var canvas = document.createElement("canvas");
            canvas.width = width;
            canvas.height = height;
            canvas.getContext("2d").drawImage(img, 0, 0, width, height);
            resolve(canvas.toDataURL("image/jpeg", 0.15))
        }
    })
}
//調(diào)用
vm.compress(vm.temp.base64img)
    .then(base64img => uploadImage({ base64img }))
    .then(response => {
        const data = response.data;
        //...
    });
陌離殤 回答

jquery對(duì)象和dom對(duì)象,jquery方法和dom方法了解一下

氕氘氚 回答

<a>你給 state.text 設(shè)置一個(gè)初始值看可以展示嗎?
<b>還有那個(gè)InputItem的屬性名不是value而是val嗎?antd路人答

antd的doc上看并未發(fā)現(xiàn)inputItem組件value屬性有一個(gè)別名叫val的。樓主還是按照第<a>的方式看下可以嗎?不行的話就是val屬性有問(wèn)題了

咕嚕嚕 回答

我找到答案了,是我的錯(cuò)。我取出的時(shí)候應(yīng)該:

this.$route.params.is_used這樣取出.

尋仙 回答

你這個(gè)寫法應(yīng)該是 vue-router 吧, vue-router 常見有三種格式的路由守衛(wèi):

1) 全局路由守衛(wèi)

如 beforeEach, afterEach

2) 路由獨(dú)享守衛(wèi)

如 beforeEnter

3) 組件獨(dú)享守衛(wèi)

如 beforeRouterEnter, beforeRouterUpdate, beforeRouterLeave

他們的應(yīng)用場(chǎng)景各不相同,你問(wèn)的太寬泛,所以都有可能。

寫個(gè)傳參方法,調(diào)用10次

苦妄 回答

https://a.com/user/account
a.com 對(duì)應(yīng)于服務(wù)器上的某個(gè)文件夾,user/account 是文件夾下底下的某個(gè)資源,由于使用了vue-route,這些資源在這個(gè)文件夾里是不存在,所以返回 404 ,所以服務(wù)器需要做url rewrite, 把所有請(qǐng)求都指向 index.html 這個(gè)文件是真實(shí)存在的.

官方給出了大部分服務(wù)器的配置方式:https://router.vuejs.org/zh-c...

或者使用默認(rèn)的hash方式, 
https://a.com/#/user/account, 這里的#分割符號(hào)之后的內(nèi)容都是服務(wù)器的路徑,只是一些參數(shù)(甚至理解為注釋),(還有URL中第一次出現(xiàn)的?是GET參數(shù)分隔符,也不會(huì)去查找), 所以不需要服務(wù)器作任何處理,因?yàn)樗械恼?qǐng)求,都是指向index.html的.

應(yīng)該能解決第二個(gè)問(wèn)題,
第一個(gè)問(wèn)題不太理解,多說(shuō)一句加了 .html 就是另一個(gè)資源.

命于你 回答

跨域了,請(qǐng)求的地址不允許來(lái)自'http://localhost:8080'的請(qǐng)求

柒喵 回答

那要看看你的ctx為什么是個(gè)Promise。