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

鍍金池/ 問答/ HTML5問答
墨沫 回答

監(jiān)聽此事件

Router.events.NavigationEnd
溫衫 回答
<view class='tab'>
  <view class='tab-menu'>
    <view class='menu' wx:for="{{tabs}}" wx:key="{{index}}" data-tabidx="{{index}}" bindtap='switchTab'>
      <text>{{item}}</text>
      <view class='currentTab' wx:if="{{tabIdx === index}}"></view>
    </view>
  </view>
  <swiper class='tab-content' current='{{tabIdx}}' bindchange='scrollTab'>
    <swiper-item>
      <view class='question-wrap'>
        <view class='question-header'>
          <text>[{{questions[current].type}}]</text>
          <text class='total'><text class='current'>{{current+1}}</text>/{{questions.length}}</text>
        </view>
        <view class='title'>{{questions[current].title}}</view>
        <view class='options'>
          <view class='opt {{questions[current].right === index ? "right" : ""}}' wx:for="{{questions[current].options}}" wx:key="{{index}}">
            <view class='tag'>
              <image src='/icons/right.png' wx:if="{{questions[current].right === index}}"></image>              
            </view>
            <view class='content'>{{item.content}}</view>
            <text class='rate'>{{item.rate}}</text>
          </view>
        </view>
      </view>
      <view class='btns'>
        <button disabled='{{current <= 0}}' bindtap="showPre">上一題</button>
        <button disabled='{{current >= questions.length-1}}' bindtap="showNext">下一題</button>
      </view>
    </swiper-item>

    <swiper-item>
      <scroll-view scroll-y class='totalRank' lower-threshold="150" bindscrolltolower="getRank">
        <view class='user' wx:for="{{ranks}}" wx:key="{{index}}">
          <image src='{{item.img_url}}' class='avator'></image>
          <view class='name'>{{item.name}}</view>
          <view class='score'>{{item.score}}分</view>
          <view class='order'>第{{item.no}}名</view>
        </view>
      </scroll-view>
    </swiper-item>
  </swiper>
</view>
page {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  font-size: 30rpx;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tab-content {
  flex: 1;
  overflow-y: auto;
}

.tab-menu {
  height: 104rpx;
  display: flex;
}

.currentTab {
  background: #42c541;
  height: 2rpx;
  width: 132rpx;
  position: absolute;
  bottom: 20rpx;
}

.tab-menu .menu {
  flex: 1;
  text-align: center;
  font-size: 28rpx;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

swiper-item {
  overflow: auto;
}

.totalRank {
  height: 100%;
}

.avator {
  width: 60rpx;
  height: 60rpx;
  border-radius: 50%;
}

.user {
  height: 88rpx;
  display: flex;
  align-items: center;
  background: #f4f4f4;
  padding: 0 43rpx;
  margin: 30rpx 30rpx 0 30rpx;
  border-radius: 10rpx;
  box-sizing: border-box;
  font-size: 24rpx;
}

.name, .score, .order {
  flex: 1;
  text-align: center;
}
.name{
  margin-left: 50rpx;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order {
  color: #42c541;
  text-align: right;
}

.question-wrap{
  display: flex;
  flex-direction: column;
  margin: 0 30rpx;
  border: 2rpx solid #DCDCDC;
  border-radius: 10rpx;
  box-sizing: border-box;
  padding: 0 50rpx;
  margin-top: 40rpx;
}
.question-header{
  display: flex;
  justify-content: space-between;
  margin-top: 60rpx;
}
/* .question-wrap .options{
  max-height: 600rpx;
  overflow: auto;
} */
.question-header .total{
  color: #E3E3E3;
}
.question-header .current{
  color: #353535;
}
.question-wrap .title{
  margin-top: 36rpx;
  min-height: 178rpx;
}
.opt{
  text-align: center;
  position: relative;
  background: #F0F0F0;
  margin-bottom: 44rpx;
  border-radius: 10rpx;
  padding: 26rpx 20rpx;
  display: flex;
  align-items: center;
}
.opt image, .opt .tag{
  width: 46rpx;
  height: 34rpx;
}
.opt .rate{
  min-width: 3em;
}
.opt .content{
  flex: 1;
  text-align: center;
}
.right{
  background: #FF920B;
  color: #FFF;
}
.btns{
  display: flex;
  margin-top: 60rpx;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 148rpx;
}
.btns button{
  width: 260rpx;
  height: 88rpx;
  line-height: 88rpx;
  text-align: center;
  border-radius: 10rpx;
  color: #FFF;
  background: #41C629;
}

.btns button:active{
  background: #179B16;
  color: #A2D7A2;
}
.btns button[disabled]:active{
  background: #F7F7F7;
  color: #ACACAC;
}
Page({
  data: {
    tabs: [
      '題目分析',
      '成績排名'
    ],
    ranks: [
      { name: '張三', score: 93 },
      { name: '李四', score: 60 },
      { name: '趙六', score: 8 },
      { name: '王五', score: 1000 },
      { name: '馮二', score: 45 }
    ],
    questions: [],
    current: 0,
    tabIdx: 0
  }
})
掛念你 回答

同一個微信用戶,同一個小程序 storage 上限為 10MB。localStorage 以用戶維度隔離,同一臺設(shè)備上,A 用戶無法讀取到 B 用戶的數(shù)據(jù)。

夢囈 回答

知道了,他用來自動加載js文件的識別碼

膽怯 回答
@change="ceshi($event)" //這里用change比較好

ceshi(event){
    //通過event.target.value可以拿到
}
怣人 回答

一般我拿到這個都是找UI要圖

荒城 回答

遇到了類似的問題 請問樓主怎么解決的

命于你 回答

cookie過大會消耗服務(wù)器的帶寬,前提是你的帶寬很小,但是流量很大。
如果是一般的小網(wǎng)站流量小,到不要緊。
放cookie的有點是,可以在服務(wù)器端獲取到,并且可以在服務(wù)器端設(shè)置和修改cookie。
localstorage只能在客戶端使用js去修改。

毀憶 回答

不能引用相對路徑中的圖片,要放到assets文件夾中

涼汐 回答

全局錯誤處理和組件錯誤處理了解一下:
https://cn.vuejs.org/v2/api/#errorHandler
https://cn.vuejs.org/v2/api/#errorCaptured

數(shù)據(jù)請求失敗提交至服務(wù)器,這個你得考慮下策略,特別是接受客戶端日志記錄的服務(wù)和數(shù)據(jù)請求服務(wù)在同一個終結(jié)點的時候。至于數(shù)據(jù)請求出錯如何做攔截,可以參考你依賴的http組件,比如 axios 可使用切片:

// Add a request interceptor
axios.interceptors.request.use(function (config) {
    // Do something before request is sent
    return config;
  }, function (error) {
    // Do something with request error
    return Promise.reject(error);
  });

// Add a response interceptor
axios.interceptors.response.use(function (response) {
    // Do something with response data
    return response;
  }, function (error) {
    // Do something with response error
    return Promise.reject(error);
  });
下墜 回答

使用自帶的modal 不就好了嘛 我使用的沒有什么問題啊。

clipboard.png

青瓷 回答

你的例子太過于復(fù)雜,什么第一層第二層的,看了老半天。

提煉你的要點:1、并發(fā) 2、高效率

1、并發(fā)

使用Promise.all就行了。比如:

await Promise.all([p1, p2, p3]);

或者直接執(zhí)行

for (let i = 0; i < datas.length; i++) {
    let info  = datas[i];
    sleep(info).then((value) => {
      console.log(value);
    });
}

參考:https://segmentfault.com/q/10...

2、高效率。
何為高效率?只不過就是你想控制并發(fā)數(shù)罷了。要么自己實現(xiàn)計數(shù),要么使用第三方封裝好的。比如async,設(shè)置并發(fā)20個

var mapLimit = require("async/mapLimit");
mapLimit(datas, 20, async function(info, callback){

    return await sleep(3);

}, function(err, result){

});

如果想弄清楚原理,這里貼一個函數(shù),可以控制并發(fā):

function map(arr, fn, concurrency) {

  concurrency = concurrency || 1;

  return new Promise(function(resolve, reject) {

    var completed = 0;
    var started = 0;
    var running = 0;
    var results = new Array(arr.length);

    (function replenish() {
      if (completed >= arr.length) {
        return resolve(results);
      };

      while (running < concurrency && started < arr.length) {
        running++;
        started++;

        var index = started - 1;
        console.log('hd', arr[index], arr[index], index);
        fn.call(arr[index], arr[index], index) // item,index
          .then(function(result) {
            // console.log('done');
            running--;
            completed++;
            results[index] = result;

            replenish();
          })
          .catch(reject);
      }
    })();
  });
}
離觴 回答

可以用1樓說的element的事件@blur
也可以用原生的方法加native

巴扎嘿 回答

你沒有給出format 函數(shù)的原型,所以只能靠猜了,有一個時間格式化的函數(shù)庫叫format.js
提供了類似的方法,但是它把format 定義在原型鏈上的,所以調(diào)用的時候 是類似這樣date.format('mm-dd-YYYY')

又不知道你的subxxx 系列函數(shù)返回的值是什么,如果返回的直接是個Date Object
哪你的調(diào)用方式 應(yīng)該是

 return subYears(now, age.age).format(dateFormat);
//如果不是,哪還要先轉(zhuǎn)換為Date對象
入她眼 回答

第一個問題是你沒有在Icon這個標(biāo)簽中設(shè)置tintColor,當(dāng)然不會改變顏色。
第二個問題,試下將Tab高度寫的高點兒

別傷我 回答

jquery 源碼 絕對有用
推薦一本書 《單頁Web應(yīng)用 JavaScript從前端到后端》這本書不用框架,全用 oop 實現(xiàn)了一個 spa 應(yīng)用,即使你在使用框架 我都推薦這本書,把spa原理都講了出來。
這兩個看完水平絕對大漲,剩下的就是積累了吧
PS:
如果可以的話,建議還是學(xué)一門 oop語言 一門函數(shù)式語言,可以 從別的 語言 借鑒很多 經(jīng)驗

傲嬌范 回答

終于解決了。

方法:babel-eslint版本問題,目前升級到8.2.1可以解決。

git上面也有類似的問題,如果解決不了可以試著到
https://github.com/eslint/esl...
找解決方法