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

鍍金池/ 問答/ HTML問答
她愚我 回答

你應(yīng)該在服務(wù)端分頁,而不是在客戶端分頁

夏木 回答

this.$echarts這個你哪來的

好難瘦 回答

估計需要重啟一下。。。

毀與悔 回答

axios是異步請求,在它外面且在下面的代碼不會等待它完成,會直接開始運行,而異步請求體里面的內(nèi)容會在其請求成功或者失敗才執(zhí)行相應(yīng)的代碼。

萌二代 回答

想在當(dāng)前頁面(xx.html)內(nèi)保存數(shù)據(jù)用vuex。
問題一和二都是這個答案。
同時,你緩存紅框部分的意義是什么呢?它的數(shù)據(jù)和狀態(tài)都是依附與當(dāng)前組件的,當(dāng)前組件銷毀了它的數(shù)據(jù)和狀態(tài)也沒了。

伐木累 回答

https://blog.csdn.net/wzygis/...

function htmlEncode(value){
  return $('<div>').text(value).html();
}
傻叼 回答

用你想用的 brackets 或者 phpstorm 編輯代碼,同時打開小程序開發(fā)工具來預(yù)覽不就好了- -

不將就 回答

沒用過mogo , 但是 這個 MongoClient.connect 方法是不是異步的?
最起碼 應(yīng)該這樣。

MongoClient.connect(url, function(err, db) {
    if (err) throw err;
    var dbo = db.db("runoob");
    dbo.collection("site").find({}).toArray(function(err, resu) { // 返回集合中所有數(shù)據(jù)
        if (err) throw err;
        result.data.datalist.push(resu[0]);
        db.close();
        next()
    });
}, function(req, res, next) {
res.send(result);

}));

扯機薄 回答

直接把在css拿出來放在文件夾,比如放在中assets/css中,在main.js中,直接import './assets/css/loaders.css.css'就好了

怣痛 回答

url上加一個參數(shù)作為區(qū)分,比如:type:0 // 1表示從外面進來的,2表示表單添加上去的

挽青絲 回答

數(shù)據(jù)請求不到,接口返回是啥?dataList打印一下嘛,看看里面具體是啥
我underscore不太熟
你試試這樣行不行。

var templateTable2 = '<% _.each(dataList, function(n){ %>\
                      <tbody><tr data-id="<%=n.id %>">\
                              <th scope="row">\
                                <input type="checkbox" id="<%=n.id %>"</th>\
                                <td><%=n.local %></td>\
                                <td><%=n.upper %></td>\
                                </tr></tbody><% });%>';
 var data= [{ id: 101,
              local:'聯(lián)通',
              upper:'北京教育網(wǎng)' 
            }, {
              id: 102,
              local:'電信',
              upper:'北京教育網(wǎng)' 
           }];
 var tpl = _.template(templateTable2)({ dataList:data });
 console.log(tpl);
青裙 回答

myNumber.add(1)得到helper函數(shù),helper(i)就是window.helper(i),所以this指向window

敢試 回答

node-static

npm i -g node-static
static --help
USAGE: /Users/svpg/.config/yarn/global/node_modules/.bin/static [-p <port>] [<directory>]

simple, rfc 2616 compliant file streaming module for node

Options:
  --port, -p          TCP port at which the files will be served                                                          [default: 8080]
  --host-address, -a  the local network interface at which to listen                                                      [default: "127.0.0.1"]
  --cache, -c         "Cache-Control" header setting, defaults to 3600                                                  
  --version, -v       node-static version                                                                               
  --headers, -H       additional headers (in JSON format)                                                               
  --header-file, -f   JSON file of additional headers                                                                   
  --gzip, -z          enable compression (tries to serve file of same name plus '.gz')                                  
  --spa               serve the content as a single page app by redirecting all non-file requests to the index html file
  --indexFile, -i     specify a custom index file when serving up directories                                             [default: "index.html"]
  --help, -h          display this help message                                                                         

使用:

# 監(jiān)聽所有網(wǎng)卡的9999端口
static -p 9999 -a 0.0.0.0
笨笨噠 回答

html:

<el-tree
    :props="props"
    :load="loadNode"
    node-key="id"
    ref="tree"
    highlight-current
    lazy
    show-checkbox
    @node-click="handleNodeClick">
  </el-tree>

data:

props: {
    label: 'indexName',
    children: [],
    isLeaf: 'leaf'
  }

js:

// 異步樹節(jié)點點擊事件
    handleNodeClick (data) {
      console.log('node', data)
    },
    // 異步樹葉子節(jié)點懶加載邏輯
    loadNode (node, resolve) {
      // console.log(node, resolve)
      // 一級節(jié)點處理
      if (node.level === 0) {
        this.requestTree(resolve)
      }
      // 其余節(jié)點處理
      if (node.level >= 1) {
        // 注意!把resolve傳到你自己的異步中去
        this.getIndex(node, resolve)
      }
    },
    // 異步加載葉子節(jié)點數(shù)據(jù)函數(shù)
    getIndex (node, resolve) {
      this.$AxiosAjax({
        loading: true,
        url: API_BASICQUOTA.getCatalogInfoByLevel,
        params: {id: node.data.id, level: node.data.level + 1 + '', type: 'all'}
      }).then(res => {
        if (res.data.code === '200') {
          // 處理節(jié)點是否是葉子節(jié)點
          res.data.catalogInfo.forEach(et => {
            if (et.isIndex === '1') {
              et.leaf = true
            } else {
              et.leaf = false
            }
          })
          let data = res.data.catalogInfo
          console.log(data)
          resolve(data)
        }
      })
    },
    // 首次加載一級節(jié)點數(shù)據(jù)函數(shù)
    requestTree (resolve) {
      this.$AxiosAjax({
        loading: true,
        url: API_BASICQUOTA.getCatalogInfoByLevel,
        params: {id: '', level: '1', type: 'all'}
      }).then(res => {
        if (res.data.code === '200') {
          // 處理節(jié)點是否是葉子節(jié)點
          res.data.catalogInfo.forEach(et => {
            if (et.isIndex === '1') {
              et.leaf = true
            } else {
              et.leaf = false
            }
          })
          let data = res.data.catalogInfo
          resolve(data)
        }
      })
    }
網(wǎng)妓 回答

八皇后問題
給你個參考,js的實現(xiàn)

const NUM_QUEENS = 8;
let solutionNum = 0;

let queens = (new Array(NUM_QUEENS)).fill(-1);
function eightQueensPuzzle(queens) {
    placeQueen(queens, 0);
    console.log(`解個數(shù)為${solutionNum}`);
}

function placeQueen(queens, row) {
    for(let i = 0; i < NUM_QUEENS; i++) {
        queens[row] = i;
        if(row == 0) {
            placeQueen(queens, row + 1);
        } else {
            if(isLegal(queens, row)) {
                if(row == NUM_QUEENS - 1) {
                    solutionNum++;
                    console.log(queens);
                } else {
                    placeQueen(queens, row + 1);
                }
            }
        }
    }
}

function isLegal(queens, row) {
    for(let i = 0; i < row; i++) {
        if(queens[row] == queens[i] || ( Math.abs(queens[row] - queens[i]) == Math.abs(row - i) )) {
            return false;
        }
    }
    return true;
}

eightQueensPuzzle(queens);

await next()和鏈式操作

比如:

// controllers/test.js
async function get (ctx, next) {
    const res = await models.test.get()
    
    ctx.state.code = 0
    ctx.state.data = res.data
    
    await next()
}
module.exports = get
import controllers from '../controllers/test'

admin.get('/category', controllers.test, async(ctx) => {
    await ctx.render('admin/category', {
        list: ctx.state.data
    });
})
耍太極 回答

async/await了解一下,這個寫法看起來挺像同步的。遇到異步的地方會堵塞,一直到異步方法執(zhí)行完成才會繼續(xù)往下執(zhí)行,達到類似同步執(zhí)行的效果。
用法很簡單,百度幾個例子看一下就明白了