鍍金池/ 問(wèn)答/ HTML問(wèn)答
未命名 回答

搞一個(gè)下載click,計(jì)數(shù),>0,remove掉,或者藏起來(lái)overflow:hidden

淡墨 回答

value和v-model的本質(zhì)是不同的,你應(yīng)該賦值的是Vue對(duì)象下的customForm.TransMode,而不是去賦值value。你對(duì)vue的了解還不夠深刻,建議先去看一下vue的文檔,而且使用了vuejs,其實(shí)不建議再使用jquery

萌二代 回答

引用類(lèi)型

由類(lèi)型的實(shí)際值引用(類(lèi)似于指針)表示的數(shù)據(jù)類(lèi)型。如果為某個(gè)變量分配一個(gè)引用類(lèi)型,則該變量將引用(或“指向”)原始值。

類(lèi)(Class)

是面向?qū)ο蟪绦蛟O(shè)計(jì)(OOP,Object-Oriented Programming)實(shí)現(xiàn)信息封裝的基礎(chǔ)。類(lèi)是一種用戶定義類(lèi)型,也稱(chēng)類(lèi)類(lèi)型。每個(gè)類(lèi)包含數(shù)據(jù)說(shuō)明和一組操作數(shù)據(jù)或傳遞消息的函數(shù)。類(lèi)的實(shí)例稱(chēng)為對(duì)象。

以上引用來(lái)自百度

“引用類(lèi)型” 和 “類(lèi)” 都是描述某類(lèi)事物的名詞。 【其實(shí)翻譯成中文后各種變扭】

我想知道引用類(lèi)型和類(lèi)的區(qū)別:

  • 他們本身就是用來(lái)描述兩種事物的名詞,這問(wèn)題只能強(qiáng)答。

  • 引用類(lèi)型 是用來(lái)描述實(shí)例在內(nèi)存里面的存在和使用的方式。

  • 類(lèi) 本身是用來(lái)某些事物的抽象。

它們都是一種包含數(shù)據(jù)和功能的數(shù)據(jù)結(jié)構(gòu):

數(shù)據(jù)結(jié)構(gòu)是計(jì)算機(jī)存儲(chǔ)、組織數(shù)據(jù)的方式。數(shù)據(jù)結(jié)構(gòu)是指相互之間存在一種或多種特定關(guān)系的數(shù)據(jù)元素的集合。通常情況下,精心選擇的數(shù)據(jù)結(jié)構(gòu)可以帶來(lái)更高的運(yùn)行或者存儲(chǔ)效率。數(shù)據(jù)結(jié)構(gòu)往往同高效的檢索算法和索引技術(shù)有關(guān)。

為什么在javascript中引用類(lèi)型不能被稱(chēng)為類(lèi)?

完全就是兩個(gè)東西,你可以說(shuō)某個(gè) 類(lèi)實(shí)例, 實(shí)例是引用類(lèi)型.
eg:

class People {
    constructor(dna) {
        this.dna= dna;
    }
}
const XiaoMing = new People('dna');
const XiaoMingAlias = XiaoMing;

People 是一個(gè)類(lèi)
XiaoMing 是一個(gè)實(shí)例,

XiaoMing 的值是 引用類(lèi)型
XiaoMingAlias 跟 XiaoMing 所指的都是同一個(gè)人,他的DNA是同樣的,個(gè)體也是一樣的,只是改了個(gè)名字而已。

很拗口~!~

安若晴 回答
var userid = 'xxxx';
html += '<input type="hidden" name="userid" value="' + userid + '"/>';
撿肥皂 回答

剛明白你的意思。
v2.x已經(jīng)沒(méi)$after了

import ProItem from '...'
var Item = new Vue({
  render: h => h(ProItem)
}).$mount()
document.body.insertBefore(Item.$el, document.querySelector('#app').nextSibling)
不二心 回答

試試這樣

this.setData({
    item : item.map(function(val){
        val.imgState = true;
        return val;
    })
})
魚(yú)梓 回答

的確ES6的importexport一定是要在最外層,不能被包含在函數(shù)或是代碼塊中。
但是這里實(shí)際上并沒(méi)有使用imports-loader吧,雖然在webpack中有配置,但是在js中并不是通過(guò)require+參數(shù)方式使用。

可以多研究下imports-loader的文檔。
https://www.npmjs.com/package...

別傷我 回答

思路一,是否可繼承類(lèi)做擴(kuò)展
思路二,你說(shuō)的新包發(fā)布再引入
思路三,發(fā)布自動(dòng)化部署調(diào)整的部分
思路四,三方包目錄做版本管理,和三有異曲同工意思

忠妾 回答

continue的意思是跳過(guò)這輪循環(huán),馬上開(kāi)始下輪循環(huán)。 在你的代碼中,執(zhí)行continue,那么if語(yǔ)句continue之后的都不執(zhí)行了。 i++后執(zhí)行新的一輪循環(huán)判斷。

若想去掉,你就反著寫(xiě)唄,即滿足xxx條件才執(zhí)行if continue下面的語(yǔ)句

for (var i = 0; i < aggregations.all_outdept_name.buckets.length; i++) {
    if (!(aggregations.all_outdept_name.buckets[i].key == '')){
        var department_obj = {
            value: aggregations.all_outdept_name.buckets[i].key,
            label: aggregations.all_outdept_name.buckets[i].key,
            count: aggregations.all_outdept_name.buckets[i].doc_count
        }
        my_department.push(department_obj);
    }
}
青黛色 回答

全局唯一字符串的有很多方法, 如基于時(shí)間, 網(wǎng)卡mac地址, cpu id等等. 標(biāo)準(zhǔn)是uuid, 生成算法是標(biāo)準(zhǔn)化的, 幾乎所有語(yǔ)言都有現(xiàn)成可用的方法.

MySQL生成uuid的方法

select uuid();

nodejs生成uuid的方法有很多種, 如用node-uuid模塊.

首先執(zhí)行:npm install node-uuid

    var uuid = require('node-uuid');
    console.log(uuid.v1())
    console.log(uuid.v4())
尤禮 回答

升級(jí)到了webapck3.0,使用了extract-text-webpack-plugin插件。此插件在3.0中必須配置和一個(gè)叫allChunks: true的參數(shù)

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

舊言 回答

application/x-www-form-urlencoded改成application/json,你得告訴服務(wù)器數(shù)據(jù)是json格式的

你的代碼等效為:

const func = () => {
  console.log(this);
};

const Person = {
  hello: func,
};

Person.hello();

那么自然就是 window 咯,聲明函數(shù)的地方是 window 嘛。

returns a value, the promise returned by then gets resolved with the returned value as its value;
throws an error, the promise returned by then gets rejected with the thrown error as its value;
returns an already resolved promise, the promise returned by then gets resolved with that promise's value as its value;
returns an already rejected promise, the promise returned by then gets rejected with that promise's value as its value.
returns another pending promise object, the resolution/rejection of the promise returned by then will be subsequent to the resolution/rejection of the promise returned by the handler. Also, the value of the promise returned by then will be the same as the value of the promise returned by the handler.
from here: https://developer.mozilla.org...
局外人 回答

opacity是改變?cè)氐耐该鞫龋⒉荒芨念伾?/p>

命于你 回答

markPoint 這個(gè)是設(shè)置你框住的那個(gè)東西的,可以試一下;
series下的markPoint,也可以全局配置markPoint

大濕胸 回答

就是一個(gè)選項(xiàng)卡功能
wxml

 <view wx:for="{{banners}}"  wx:for-item="banner" wx:for-index="idx" >
 <image src="{{banner.img}}" />
 <view>
  <image wx:for="{{banner.imgs}}" data-idx="{{idx}}"  data-index="{{index}}"class="thumbnail {{banner.index==index?'cur':''}}" src="{{item}}"  catchtap="showBanner" />
 <text> {{banner.index}}</text>
 </view>
</view> 

wxss

.thumbnail{
  width: 100rpx;
  height: 100rpx;
  margin-right: 10rpx;
   border: 2px solid transparent;
}
.cur{
  border: 2px solid red;
}

js

Page({
    data: {
         banners: [
          {
            index: 0,
            img: 'https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=a80e4a17ae014c080d3620f76b12696d/42166d224f4a20a40709fb7997529822720ed07d.jpg',
            imgs: ['https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=a80e4a17ae014c080d3620f76b12696d/42166d224f4a20a40709fb7997529822720ed07d.jpg', 'https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=00c4cfe352fbb2fb202650402e234bc1/d62a6059252dd42a711ec615043b5bb5c9eab87d.jpg', 'https://gss0.bdstatic.com/-4o3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=66342e1187d4b31ce4319ce9e6bf4c1a/54fbb2fb43166d22639320c64a2309f79152d2ff.jpg', 'https://gss2.bdstatic.com/9fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike180%2C5%2C5%2C180%2C60/sign=9e8ac1c952df8db1a8237436684ab631/3ac79f3df8dcd100784b38707e8b4710b8122f88.jpg'],

          },
          {
            index: 0,
            img: 'https://gss1.bdstatic.com/-vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=005e5fcd9aef76c6c4dff379fc7f969f/9358d109b3de9c8234db74636681800a18d843a4.jpg',
            imgs: ['https://gss1.bdstatic.com/-vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=005e5fcd9aef76c6c4dff379fc7f969f/9358d109b3de9c8234db74636681800a18d843a4.jpg', 'https://gss2.bdstatic.com/9fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike180%2C5%2C5%2C180%2C60/sign=53d730f8daa20cf4529df68d17602053/8d5494eef01f3a2927a062b19325bc315c607c60.jpg', 'https://gss0.bdstatic.com/-4o3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=d45d73693f7adab429dd1311eabdd879/562c11dfa9ec8a134f6397a1fe03918fa0ecc072.jpg', 'https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike180%2C5%2C5%2C180%2C60/sign=5354a1279925bc313f5009ca3fb6e6d4/7e3e6709c93d70cf4566dee4f8dcd100bba12bbe.jpg'],

          },
          {
            index: 0,
            img: 'https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=47772d4895510fb36c147fc5b85aa3f0/8326cffc1e178a8218bb1c51fd03738da877e8b8.jpg',
            imgs: ['https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=47772d4895510fb36c147fc5b85aa3f0/8326cffc1e178a8218bb1c51fd03738da877e8b8.jpg', 'https://gss1.bdstatic.com/9vo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike116%2C5%2C5%2C116%2C38/sign=4ab22f86f91fbe090853cb460a096756/e850352ac65c1038623ade32b9119313b17e89fd.jpg', 'https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike180%2C5%2C5%2C180%2C60/sign=82905fe6e0f81a4c323fe49bb6430b3c/5882b2b7d0a20cf4bf0e134d7d094b36adaf9982.jpg', 'https://gss0.bdstatic.com/94o3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike180%2C5%2C5%2C180%2C60/sign=83659ab63212b31bd361c57be7715d1f/622762d0f703918f50043b3b5a3d269758eec46e.jpg', 'https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike92%2C5%2C5%2C92%2C30/sign=c2765b7686b1cb132a643441bc3d3d2b/b8014a90f603738d5fa93cbbb81bb051f919ec4c.jpg'],

          },
        ],
    },
    showBanner:function(e){
      let i = e.target.dataset.idx,
          j = e.target.dataset.index,
          banners = this.data.banners;
      banners[i].index=j;
      banners[i].img = banners[i].imgs[j]
      this.setData({ 
        banners: banners
      })
    }
})

完整案例