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

鍍金池/ 問(wèn)答
初心 回答

vue-router 用 this.$route, 比如:
<li v-for="(menu,n) in menus" :key="n"" :class="{'active': this.$route.path === menu.href}"></li>


如果普通點(diǎn)擊,可以在加入一個(gè)自段 selectedMenu: “選擇的menu對(duì)象”, 比如:
menus:[{title: '百度', href: 'www.baidu.com'}, {title: '百度2', href: 'www.baidu.com2'}];

<li v-for="(menu,n) in menus" :key="n"" @click="changePath(menu)" :class="{'active': this.selectedMenu.href === menu.href}"></li>

changePath(menu) {

this.selectedMenu = menu;

}

半心人 回答

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

誮惜顏 回答

現(xiàn)代瀏覽器應(yīng)該是按順序加載 js 的,因此在 head 里的 js 肯定會(huì)比 webpack 打包后插入的 js 先加載。

簡(jiǎn)單代碼驗(yàn)證如下:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>JS Order Test</title>

  <script src="https://cdn.bootcss.com/echarts/4.0.4/echarts.min.js"></script>
</head>
<body>
  
  <script>
    console.log(echarts)
  </script>
</body>
</html>

按理不會(huì)出現(xiàn)你所說(shuō)的這個(gè)問(wèn)題,但既然出現(xiàn)這樣的問(wèn)題了,webpack externals 配置了解一下。

https://webpack.js.org/config...

呆萌傻 回答

當(dāng)你只需要一個(gè)不變的空列表的時(shí)候就用得到empytList啊,emptyMap同理。還有一點(diǎn)可以看一下源碼:

private static class EmptyList<E>
        extends AbstractList<E>
        implements RandomAccess, Serializable {
    private static final long serialVersionUID = 8842843931221139166L;

    public Iterator<E> iterator() {
        return emptyIterator();
    }
    public ListIterator<E> listIterator() {
        return emptyListIterator();
    }

    public int size() {return 0;}
    public boolean isEmpty() {return true;}

    public boolean contains(Object obj) {return false;}
    public boolean containsAll(Collection<?> c) { return c.isEmpty(); }

    public Object[] toArray() { return new Object[0]; }

    public <T> T[] toArray(T[] a) {
        if (a.length > 0)
            a[0] = null;
        return a;
    }

    public E get(int index) {
        throw new IndexOutOfBoundsException("Index: "+index);
    }

    public boolean equals(Object o) {
        return (o instanceof List) && ((List<?>)o).isEmpty();
    }

    public int hashCode() { return 1; }

    @Override
    public boolean removeIf(Predicate<? super E> filter) {
        Objects.requireNonNull(filter);
        return false;
    }
    @Override
    public void replaceAll(UnaryOperator<E> operator) {
        Objects.requireNonNull(operator);
    }
    @Override
    public void sort(Comparator<? super E> c) {
    }

    // Override default methods in Collection
    @Override
    public void forEach(Consumer<? super E> action) {
        Objects.requireNonNull(action);
    }

    @Override
    public Spliterator<E> spliterator() { return Spliterators.emptySpliterator(); }

    // Preserves singleton property
    private Object readResolve() {
        return EMPTY_LIST;
    }
}

EmptyList里面沒(méi)有用來(lái)描述列表信息及保存列表元素的成員變量,獲取EmptyList對(duì)象與直接new一個(gè)ArrayListLinkedList相比,可以節(jié)省不必要的空間。

瘋浪 回答

stream,讀一次就空了啊。就像袋子里有個(gè)蘋(píng)果,你拿出來(lái)袋子就空了。要么把你讀出來(lái)的stream set回去,要么把你讀出來(lái)的stream作為參數(shù)傳遞,不能多次讀stream。

墨沫 回答

你可以把數(shù)據(jù)傳進(jìn)去:carList='arr',指令中通過(guò)binding.value獲取,你這里是al.value

兔寶寶 回答

1樓的答案不錯(cuò),我這里寫(xiě)的容易理解一點(diǎn),推薦使用1樓的方式

var arr=[{'a':7},{'b':2},{'c':0},{'d':5},{'e':1}];
var maxVal = 0;
var maxKey = '';

for (var i=0, len=arr.length; i<len; i++) {
    var o = arr[i];
    var values = Object.values(o);
    var keys = Object.keys(o);
    
    if (values[0] > maxVal) {
        maxVal = values[0];
        maxKey = keys[0];
    }
}
浪蕩不羈 回答

ubuntu16.04, vim8.0.727表示:V"+y沒(méi)有問(wèn)題。

誮惜顏 回答

以某一個(gè)表的字段為主,其他的表相關(guān)字段設(shè)成外鍵,通過(guò)數(shù)據(jù)庫(kù)級(jí)聯(lián)更新的機(jī)制,會(huì)很簡(jiǎn)單,因?yàn)槟阒恍枰轮鞅淼淖侄渭纯?

溫衫 回答

.vue 文件實(shí)際是為了把vue組件化化的,如果不多的話,可以手動(dòng)添加想要的組件,把組件的style 放到css文件中,模版和js放在組件中。
有兩種方式,一種是全局組件:

Vue.component('my-component', {
  template:'',
   data:function(){
     return {}
}
})

另一種是局部組件,
直接

  var   myComponentName = {
        template:"",
        data:function(){
        }
    }

希望能幫到你

櫻花霓 回答

如果層數(shù)確定的話,可以這樣做:

<script>
    var ad = [
        {
            "id": 1,
            "display_name": "儀表盤(pán)",
            "children": []
        },
        {
            "id": 2,
            "display_name": "用戶權(quán)限管理",
            "children": [
                {
                    "id": 3,
                    "display_name": "用戶列表",
                    "children": [
                        {
                            "id": 5,
                            "display_name": "創(chuàng)建管理員"
                        },
                        {
                            "id": 6,
                            "display_name": "刪除用戶"
                        },
                        {
                            "id": 7,
                            "display_name": "用戶禁用/取消禁用"
                        },
                        {
                            "id": 8,
                            "display_name": "更新用戶所在角色組"
                        }
                    ]
                }
            ]
        }];

    var the_id = 5;
    var the_select_id = [];

    for(var i in ad){
        if (ad[i].id !== the_id) {
            for(var j in ad[i].children) {

                if (ad[i].children[j].id !== the_id) {
                    for(var k in ad[i].children[j].children) {

                        if (ad[i].children[j].children[k].id == the_id) {
                            the_select_id.push(ad[i].children[j].children[k].id);
                            the_select_id.push(ad[i].children[j].id);
                            the_select_id.push(ad[i].id);
                        }
                    }
                } else {
                    the_select_id.push(ad[i].children[j].id);
                    the_select_id.push(ad[i].id);
                }
            }
        } else {
            the_select_id.push(ad[i].id);
        }
    }

    console.log(the_select_id);
</script>

效果如圖:

clipboard.png

當(dāng)然,代碼還可以精簡(jiǎn)優(yōu)化,這里只是提供個(gè)參考

魚(yú)梓 回答

細(xì)細(xì)想想,數(shù)據(jù)從哪來(lái),到哪去。 這個(gè)過(guò)程,你可以這么理解

1.通過(guò)后臺(tái)添加數(shù)據(jù)到表中
2.表中的數(shù)據(jù)需要展示到頁(yè)面中

那么如何展示到頁(yè)面中呢?

首先,你需要一個(gè)html的頁(yè)面,頁(yè)面渲染的形式包括:

1.數(shù)據(jù)傳遞到頁(yè)面,直接進(jìn)行渲染 (mvc一般是這么處理的 通用的處理方式)
2.訪問(wèn)后端的接口,js進(jìn)行頁(yè)面數(shù)據(jù)填充 (現(xiàn)在更好的處理方式,更好的分工)
3.頁(yè)面中直接編寫(xiě)php,混編頁(yè)面(不推薦)后期改起來(lái)超級(jí)惡心,代碼可讀性極差

所以,建議你可以寫(xiě)個(gè)接口 前端可以訪問(wèn)接口進(jìn)行數(shù)據(jù)處理,也可以找個(gè)模板引擎進(jìn)行處理,頁(yè)面可讀性會(huì)更好 




window.top.location。
如果跨域了可以考慮監(jiān)聽(tīng)hash和Message

涼薄 回答

從技術(shù)角度看,不是非要有個(gè)自動(dòng)釋放池.因?yàn)閴K的末尾恰好是應(yīng)用程序的終止處,而此時(shí)操作系統(tǒng)會(huì)將引用程序所占的全部?jī)?nèi)存都釋放掉.雖說(shuō)如此,但是如果不寫(xiě)這個(gè)塊的話,那么由UIApplicationMain函數(shù)所自動(dòng)釋放的那些對(duì)象,就沒(méi)有自動(dòng)釋放池可用,于是系統(tǒng)發(fā)出了警告,所以說(shuō),這個(gè)池子可以理解成最外圍捕捉自動(dòng)釋放對(duì)象用的.

礙你眼 回答
  1. 所以使用module中的必須要用module.exports和require?

首先你是nodejs,8以上支持import-export,但要加運(yùn)行參數(shù),并且改為.mjs,詳情看官網(wǎng)。

2.如果是按上面的方法的話不是還是將整個(gè)模塊導(dǎo)入然后再?gòu)哪K中讀取特定屬性,可是我看阮一峰的教程中是說(shuō)只加載import的方法?

據(jù)我所知,無(wú)論require還是import都是整個(gè)模塊導(dǎo)入,這是nodejsrequire實(shí)現(xiàn)以及ES6import規(guī)范,let {foo,bar} = ...只是解構(gòu)語(yǔ)法。

參考鏈接MDN import

Given an object or value named myExport which has been exported from the module my-module either implicitly (because the entire module is exported) or explicitly (using the export statement), this inserts myExport into the current scope.
import {myExport} from '/modules/my-module.js';
命多硬 回答

@奧斯卡僚機(jī) 老哥,看好問(wèn)題。

你該告訴她:如果你是 Chrome 或 Firefox 瀏覽器,你可以:

  • 如何查看頁(yè)面源代碼(Ctrl + U)、
  • 如何獲取到對(duì)應(yīng) DOM 的位置及標(biāo)簽的即時(shí)變化(檢查:Ctrl + Shift + C)。

在有這兩個(gè)操作后,如果提問(wèn)者想解析,費(fèi)點(diǎn)時(shí)間,自然可以解析出來(lái)。


就算是模擬出來(lái):

檢測(cè)圖片列表 DOM 的 onClick 事件,然后在大圖的 src 屬性上替換對(duì)應(yīng)的圖片鏈接即可。

簡(jiǎn)單明了一點(diǎn),畢竟你不是在講話,而是寫(xiě)答案。

入她眼 回答

python 相對(duì)來(lái)說(shuō)爬蟲(chóng)庫(kù)比較完善,網(wǎng)絡(luò)和進(jìn)程方面?zhèn)€人認(rèn)為要優(yōu)于PHP的爬蟲(chóng)

薔薇花 回答

github上搜索PLC和Android

萌面人 回答

對(duì)于你的需求,可以通過(guò)判斷 參數(shù)的類型來(lái)進(jìn)行不同的處理嘛

sem_timewait 函數(shù)會(huì)阻塞當(dāng)前線程直到拿到鎖或超時(shí)才會(huì)返回。阻塞的實(shí)現(xiàn)方式就是休眠當(dāng)前線程,直到鎖釋放或者超時(shí)后喚醒。
超時(shí)后這個(gè)函數(shù)返回繼續(xù)執(zhí)行后面的代碼,后面的代碼邏輯決定后面的行為。

休眠是阻塞的一種實(shí)現(xiàn)或者說(shuō)表現(xiàn)方式,二者不是一個(gè)層面的概念。