鍍金池/ 問答/ HTML問答
話寡 回答

汗,換電腦用vscode時git目錄多了一層文件夾

陪妳哭 回答

用個全局變量,默認為false,捕獲一次之后設置為false,在事件處理函數(shù)里判斷為true的情況下繼續(xù)冒泡,否則不冒泡

貓館 回答

iview是基于vue框架的,要先引入vue.js再引入iview.js

毀與悔 回答

你也看到了requests的結(jié)果是response success而不是http success,只要有響應這個請求都是成功的,只有請求一個不存在的網(wǎng)址或者網(wǎng)絡錯誤才會響應失敗。舉個例子是一個是賣雞蛋沒買回來,一個是賣了壞的雞蛋回來

柒喵 回答

同跟樓上的想法類似,先進行數(shù)據(jù)的預處理會比較方便,當然 如果后臺會給你做這個事情更好,但是,自己處理一下也不是難事。

let articleList = [
  { id: 1, name: '小紅', user: 456312, Occupation: '教練' },
  { id: 2, name: '小張', user: 456321, Occupation: '歌手' },
  { id: 5, name: '小強', user: 456312, Occupation: '老師' },
  { id: 2, name: '小分', user: 456312, Occupation: '同事' },
  { id: 5, name: '小撒', user: 456132, Occupation: '總經(jīng)理' },
  { id: 2, name: '小看', user: 456132, Occupation: '程序猿' },
  { id: 5, name: '小貧', user: 451632, Occupation: '演員' },
];

let hashMap = articleList.reduce((hashMap, next) => {
  hashMap[next.id] = hashMap[next.id] ? [...hashMap[next.id], next] : [next];
  return hashMap;
}, {});
console.log(hashMap);
筱饞貓 回答

使用render函數(shù),進行渲染

    {
          prop: "",
          label: "操作",
          render: (h, param) => {
            const dropDownData = {
              label: "操作",
              items: [
                { label: "修改", func: { func: "update", uuid: param.row.uuid } },
                { label: "刪除", func: { func: "del", uuid: param.row.uuid } }
              ]
            };
            // 觸發(fā)MyDropDown的update和del事件
            return h(MyDropDown, {
              props: { dropDownData: dropDownData },
              on: { update: this.update, del: this.del }
            });
          }
        }

其中,MyDropDown是我自己封裝的下拉菜單組件,通過props傳給組件值,on來監(jiān)聽觸發(fā)的事件

MyDropDown組件

<template>
    <el-dropdown trigger="click" @command="handleCommand">
        <el-button type="primary">
            <span v-text="dropDownData.label"></span><i class="el-icon-arrow-down el-icon--right"></i>
        </el-button>
        <el-dropdown-menu slot="dropdown" >
            <el-dropdown-item :command="item.func"  v-text="item.label" v-for="(item,index) in dropDownData.items" :key="index"></el-dropdown-item>
        </el-dropdown-menu>
    </el-dropdown>
</template>

<script>
export default {
  props: ["dropDownData"],
  methods: {
    handleCommand(command) {
      this.$emit(command.func, command.uuid);
    }
  }
};
</script>

這是一個簡單的封裝element-ui 的 dropDown組件,通過handleCommand方法觸發(fā)事件

------2018年01月13日23:10:32 補充
render渲染函數(shù)代碼也一起貼上來

<script>
export default {
  functional: true,
  props: {
    row: Object,
    render: Function
  },
  render: (h, ctx) => {
    return ctx.props.render(h, ctx.props.row);
  }
};
</script>
尕筱澄 回答

template標簽里寫兩個<div v-on:click="arrowChange"><img src="up.png" v-show="isup"><img src="down.png" v-show="!isup"></div>,data里定義isup的值為true,methods里添加arrowChange:function(){this.arrowChange=!this.arrowChange},就可以了

笨尐豬 回答
極限可能是5萬個字符的字符串

自己先算一下多大吧。

算你一個字符占 4 個字節(jié),一共 20萬字節(jié),不到 200K 的數(shù)據(jù),你覺得很大?

涼汐 回答
        *{
            padding: 0;
            left: 0;
        }
        body{
            padding-top: 50px;
        }
        .header{
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 50px;
            line-height: 50px;
            text-align: center;
            background-color: red;
            z-index: 10001;
        }
        .layout{
            display: flex;
            position: relative;
        }
        .layout .layout-left{
            flex: 0 0 200px;
            flex-direction:column;
            width: 200px;
            color: #fff;
            background-color: blue;
        }
        .layout .layout-right {
          background-color: yellow;
          overflow-y: auto;
          overflow-x: hidden;
          position: absolute;
          left:215px;
          top: 0;
          bottom: 0;
          right: 0;
          margin: auto;
      }
北城荒 回答

各位大哥,小弟錯了。redux-observable 這么著名的 redux 中間件怎么會有這種問題呢。

function (action$: Observable<Action>, store: Store): Observable<Action>;

這是 redux-observable 的處理 action 的回調(diào)函數(shù),第二個參數(shù)就是 store。也就是說 redux-observable 可以同時獲取 action 和 store,像 reducer 一樣的處理數(shù)據(jù)流。

看一些例子遠遠不夠,還是要老老實實啃文檔 233

亮瞎她 回答

請問你解決了嗎,我也遇到這個問題了

厭惡我 回答

假設你的域名是www.abc.com
首先你在后臺按照現(xiàn)有的form,用Gravity Forms新建一個一模一樣的form,注意字段的name要完全匹配,取得這個form的ID號,假設是1

然后把你現(xiàn)有的form的提交地址寫成:
http://www.abc.net/gravityfor...×××××&signature=×××××&expires=1497603994

api_key和signature在 Gravity Forms的設置 - Web API里獲取。上面這個URL也可以在Web API的開發(fā)者工具里面直接獲取

就這么簡單

拮據(jù) 回答

什么版本的安卓機器,是所有的安卓機器都會這樣嗎?還是部分

寫榮 回答

你是通過js控制的,賦值的時候給第2個一起賦值就行了

朕略萌 回答

js想取mac碼只能在IE瀏覽器下通過ActiveX取得,如果是想要一個唯一標識的話可以取guid
下面這個函數(shù)可以生成一個隨機guid,碰撞幾率可以忽略不計,可以認為是唯一的。
這個函數(shù)也是網(wǎng)上找的,在我的項目中使用過

function generateUUID() {
var d = new Date().getTime();
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
  var r = (d + Math.random()*16)%16 | 0;
  d = Math.floor(d/16);
  return (c=='x' ? r : (r&0x3|0x8)).toString(16);
});
return uuid;
};
背叛者 回答

偽類不是真正的DOM,不能被js的選擇器選擇,所以不能綁定事件

伐木累 回答

1.小括號的用法之一是執(zhí)行單個或多個表達式,并返回最后一個表達式的值,多個表達式之間需要用逗號“,”分隔開
例:(1,2+3,4+5,6)//代碼會被一次執(zhí)行,最后將6作為返回值
2.自執(zhí)行匿名函數(shù)(function(){})()
所以你這個可以看做等于(eval)('1+1')
再次等于 eval('1+1')

墨小羽 回答

當然可以,就是第一次timeEnd不會生效而已。