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

鍍金池/ 問(wèn)答/ HTML問(wèn)答
故人嘆 回答

你框選的是城市選擇組件里對(duì)應(yīng)的城市數(shù)據(jù),而且好幾個(gè)版本都引入了,建議使用路由懶加載進(jìn)行打包分割

雨萌萌 回答

沒(méi)有引入 html格式的加載器,你需要一個(gè) loader來(lái)操作這類(lèi)型的文件

你的代碼在第二個(gè)循環(huán)里加上索引,傳值時(shí)傳foodIndex,因?yàn)槟阋氖屈c(diǎn)擊food

 <div v-for="(food,foodIndex) in item.foods" v-show="name==item.name" class = 'food' :class="{'food-selected':foodIndex== activeIndex}"  @click ="addCart(food,foodIndex)" >

我的demo也換為多層循環(huán)了,數(shù)據(jù)結(jié)構(gòu)跟你差不多,一樣的可以的,你要注意下每層循環(huán)的索引要對(duì)應(yīng)每一層,不要寫(xiě)錯(cuò)了

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>changeClass</title>
  <script src="https://cdn.bootcss.com/vue/2.5.13/vue.js"></script>
<style>
.active{color:red;}
</style>
</head>
<body>

<div id="app">
  <div>
    <div v-for="(item,index) in goods">
      {{item.value}}
      <div v-for="(food,foodIndex) in item.foods" class="default" :class="{'active':item.activeIndex == foodIndex}" @click="changeClass(index,foodIndex)">
        {{food.name}}
      </div>
    </div>
  </div>
</div>
</body>
</html>

<script>
var app = new Vue({
  el:'#app',
  data:{
    goods:[
      {value:'食物',foods:[{name:1},{name:2},{name:3},{name:4}],activeIndex:null},
      {value:'菜',foods:[{name:1},{name:2},{name:3},{name:4}],activeIndex:null},
      {value:'飲料',foods:[{name:1},{name:2},{name:3},{name:4}],activeIndex:null}
    ],
  },
  methods:{
    changeClass:function(index,foodIndex){
      if(this.goods[index].activeIndex == foodIndex){
        this.goods[index].activeIndex = null;
      }else{
        this.goods[index].activeIndex = foodIndex;
      }
    }
  }
})
</script>
涼汐 回答

把rbac數(shù)據(jù)整理好之后,用Treeview的js插件去渲染出來(lái)。

呆萌傻 回答

可以對(duì)它使用css樣式 transform:scale進(jìn)行縮放,比如下面的例子縮放50%

<polyline class="a" points="4960,1920 11040,8000 4960,14080 " style='transform:scale(0.5)'></polyline>
悶騷型 回答

httpClient函數(shù)還是被調(diào)用有沒(méi)有指定return,就是默認(rèn)返回undefinded
而你需要做的就是:
傳入一個(gè)回調(diào)函數(shù)給httpClient



function httpClient(callback){

    new Promise(function(resovle,reject){
        //模擬異步執(zhí)行
        setTimeout(function(){
            resovle("DONE~~~~~");
            //reject(new Error("failed"));
        },1000);
    }).then(function(resultData){
        console.log("++++")
        callback&&callback.apply(null,[null,resultData]);
    }).catch(function(error){
        callback&&callback.apply(null,[error]);
    });
}


function runHttpClient(){
    new Promise(function(resovle,reject){
        httpClient(function(error,data){
            if(error){
                reject(error);
                return;
            }
            resovle(data);
        });
    }).then(function(result){
        console.log(">>>"+result);
    }).catch(function(error){
        console.err(error);
    });
}

runHttpClient();

或者讓httpClient返回一個(gè)promise

function httpClient_promise(){

    return new Promise(function(resovle,reject){
        //模擬異步執(zhí)行
        setTimeout(function(){
            resovle("DONE~~~~~");
            //reject(new Error("failed"));
        },1000);
    });
}

function runHttpClient2(){
    httpClient_promise().then(function(result){
        console.log(">>>"+result);
    }).catch(function(error){
        console.err(error);
    });
}

runHttpClient2();
尐潴豬 回答

vue單頁(yè)應(yīng)用,現(xiàn)在網(wǎng)上你能找到的,都是vue+webpack。

JQ+GULP

1、首先你得把GULP替換成webpack
2、數(shù)據(jù)渲染你得確認(rèn)項(xiàng)目中用了其他模板引擎沒(méi)有,有就相對(duì)容易改些,vue也算是模板引擎的一種
3、最麻煩的地方在于,jquery可以非常方便的操作DOM,vue不能
4、剩下的就是業(yè)務(wù)方面的事情了
神曲 回答

在 vue 里,:key 的作用是方便 vue 辨識(shí) DOM,這樣,如果在重新渲染時(shí)遇到和之前完全相等的 key,就可以不用渲染,節(jié)省時(shí)間。所以寫(xiě)的時(shí)候就要用簡(jiǎn)單可識(shí)別的值,比如 id,或者索引。

你的問(wèn)題是 index in list 得到的是 list 里的某個(gè)對(duì)象,而不是真正的索引,你可以 (subCompany, index) in list 就可以了。

還是建議好好看兩遍文檔。

呆萌傻 回答

嗯 我們做法是把js對(duì)應(yīng)的api封裝一下,直接調(diào)用js封裝的function,用callback做返回結(jié)果處理。

所有api都是 /api/user/{id} 這種格式的

忠妾 回答

1、maven的地址是阿里巴巴的內(nèi)網(wǎng)地址,所以一直卡在這個(gè)地方。
2、屏蔽掉這個(gè)地址后,會(huì)報(bào)com.taobao.android:weexplugin-gradle-plugin找不到,確實(shí)jcenter中也沒(méi)有這個(gè),所以我現(xiàn)在也是卡在這里了,android連個(gè)hello word都跑步起來(lái)?。?!
3、官方群無(wú)人回應(yīng),悲催!

何蘇葉 回答
    function async2() {
        console.log( 'async2');
    }
    async function async1(resolve) {
        await setTimeout(function () {
            console.log("settimeout");
            //當(dāng)我認(rèn)定async1完成后才開(kāi)始async2
            resolve()
        },0);
    }
    new Promise(function (resolve) {
        async1(resolve)
    }).then(function () {
        async2()
    });
或者
new Promise(function (resolve) {
        async1()
        resolve()
    }).then(function () {
        async2()
    });
鐧簞噯 回答

clipboard.png
正好前幾天看到一個(gè) 試了一下很強(qiáng)

朽鹿 回答

同樓上 是不是沒(méi)裝loader

妖妖 回答

是不是默認(rèn)樣式?jīng)]有被重置導(dǎo)致的?

毀了心 回答
.liner {
  height: 66px;
  background-repeat: no-repeat;
  background-size: 20% 100%, 40% 100%, 60% 100%, 80% 100%, 100% 100%;
  background-position: 0 bottom;
  background-image:
    linear-gradient(#000,#000),
    linear-gradient(green, green),
    linear-gradient(pink, pink),
    linear-gradient(yellow, yellow),
    linear-gradient(orange, orange);
}

我試了也是須的(估計(jì)是chrome bug),所以換了個(gè)路子,這樣就可以了

參考鏈接

掛念你 回答

sessionStorage 為每一個(gè)給定的源(given origin)維持一個(gè)獨(dú)立的存儲(chǔ)區(qū)域,該存儲(chǔ)區(qū)域在頁(yè)面會(huì)話期間可用(即只要瀏覽器處于打開(kāi)狀態(tài),包括頁(yè)面重新加載和恢復(fù))。Web Storage API

愚念 回答

定時(shí)器做的只是把變量num做了++;

if($length > 1){
        $ul.append($li.eq(0).clone());
      
        setInterval(
            function(){
                num++;
                $ul.addClass("animate").css("-webkit-transform","translateY(-"+ $liHeight*(num) +"px)");
                setTimeout(
                    function(){
                        if(num == $length){
                            $ul.removeClass("animate").css("-webkit-transform","translateY(-70px)");
                            num = 2;
                        }
                    },1000);
            },1000);
    }

可以把3000改為1000,這樣就會(huì)快一些