鍍金池/ 問(wèn)答/ UI問(wèn)答
情皺 回答

根據(jù)你的實(shí)際情況,外圍view需要給個(gè)width,我默認(rèn)用了100%.
還有若在不動(dòng)你的結(jié)構(gòu)上用flex實(shí)現(xiàn)左右布局,內(nèi)部的view看起來(lái)不能動(dòng)它的樣式,那么只有在左右兩部分中間插入一個(gè)空白區(qū)域,這個(gè)區(qū)域的寬度,這個(gè)區(qū)域的寬度根據(jù)你的需要設(shè)定。

    <view style='display:flex;justify-content:space-between; align-items:center; width: 100%'>
        <image></image>
        <image></image>
        <image></image>
        <image></image>
        <image></image>
        <image></image>
        <div style='flex-basis:10%'></div>
        <view>查看更多</view>
    </view>
浪婳 回答
  1. 建議參考使用Flexible實(shí)現(xiàn)手淘H5頁(yè)面的終端適配
  2. 建議參考lib-flexible源碼讀后感:

    最后給body設(shè)置font-size,作者團(tuán)隊(duì)也解釋了(原話):
    body上設(shè)置12 * dpr的font-size值,為了重置頁(yè)面中的字體默認(rèn)值,不然沒有設(shè)置font-size的元素會(huì)繼承html上的font-size,變得很大。
離觴 回答

應(yīng)該是jquery

clipboard.png
這個(gè)效果可以通過(guò)錨操作實(shí)現(xiàn)

clipboard.png

解夏 回答

使用flex布局,橫向排列,允許換行,高度一致,每一塊占據(jù)33.33%的寬度

厭遇 回答

不知道你iframe代碼的結(jié)構(gòu)和內(nèi)容。嘗試下,把iframe中的內(nèi)容放到一個(gè) .html中,然后在你需要加標(biāo)識(shí)的地方用a標(biāo)簽套你的img,把href屬性指到剛剛那個(gè).html。

陌南塵 回答

props傳遞,這也是大部分UI組件使用的方式。你這已經(jīng)是父子組件了當(dāng)然是采用props down, events up
如無(wú)必要盡量少的直接操作dom,因?yàn)関ue的思想數(shù)據(jù)驅(qū)動(dòng)視圖,而不是直接操作.
當(dāng)然一些場(chǎng)景下還是有必要使用$refs的,比如獲取一個(gè)元素的寬高..

其實(shí)更多的是工作流程,和工作協(xié)同的區(qū)別。

墻頭草 回答
import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'

import Account from '@/components/user/Account'
import Course from '@/components/user/Course'
import Order from '@/components/user/Order'

import store from './../vuex/index'

Vue.use(Router)

function guardRoute (to, from, next) {
  if (!store.state.isLogin) {
    next({ path: '/login' });
  } else {
    next()
  }
}

const vueRouter = new Router({
  routes: [
    {
      path: '/hello',
      name: 'HelloWorld',
      component: HelloWorld
    },
        {
            path: '/login',
            name: 'login',
            component: Login
        },
        {
            path: '/account',
            name: 'account',
            component: Account,
            meta: {
                needAuth: true
            }
        },
        {
            path: '/course',
            name: 'course',
            component: Course,
            meta: {
                needAuth: true
            }

        },
        {
            path: '/order',
            name: 'order',
            component: Order,
            meta: {
                needAuth: true
            }

        },
  ]
});

vueRouter.beforeEach(function (to, from, next) {
    if (to.matched.some(m => m.meta.needAuth)) { 
      guardRoute(to, from, next)
    } else {
      next()
    }
});

export default vueRouter
敢試 回答

div2加overflow:scroll就行了,正常應(yīng)該是div2寬度等于ul寬度2000,多出來(lái)的40應(yīng)該是ul的margin。

愛礙唉 回答

1.通過(guò)地址欄參數(shù)傳遞
2.通過(guò)localstorage,sessionStorage等技術(shù)
跳轉(zhuǎn)前記得攜帶參數(shù)就行了

//https://mail.qq.com/cgi-bin/frame_html?sid=EJs87usyg4jSZy51&t=newwin_frame&url=%2fcgi-bin%2freadmail%3fmailid%3dZC1927-zkXnZWC5bWY8MnsgobyyP87%26need_textcontent%3dtrue%26s%3dnotify%26newwin%3Dtrue%26t%3dreadmail&r=9f2c2de4f4d1a5acaa0109db8fadf7cd

function getQueryString(name) {
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}

getQueryString('sid')
"EJs87usyg4jSZy51"

圖片描述

朕略萌 回答

if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {

    //移動(dòng)端

}else{

    //PC

}

只愛你 回答

外層再嵌套一層div,display: flex; justify-content: center; 然后修改的justify-content .page-mod .pagination { justify-content: flex-start }
不行去 http://test.cxxgame.com/tourn... 看賽事信息部分的樣式

柒喵 回答

如果你每次去服務(wù)器獲取15張圖片的數(shù)據(jù)相對(duì)來(lái)說(shuō)消耗還是比較大的,為什么不把圖片存在一個(gè)地方,每次請(qǐng)求圖片的url,讓瀏覽器自己從url獲取即可,至于緩存,瀏覽器本身會(huì)自己緩存圖片,當(dāng)你在沒有清理緩存的時(shí)候,都是從本地緩存先進(jìn)行對(duì)比,如果更新才會(huì)獲取,建議你深入了解下瀏覽器的工作原理

夕顏 回答
function cell(value,row,index){
        if(row.test>=row.y){
            return '<div class="progress progress-striped active"><div class="progress-bar progress-bar-success" style="width:'+value+'" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" >'+value+'</div></div>';
        }else{
            return '<div class="progress progress-striped active"><div class="progress-bar progress-bar-info" style="width:100%" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" >'+value+'</div></div>';
        }
    }
敢試 回答

justify-content: space-around; 可以用 -ms-flex-pack: distribute;代替;
justify-content: space-between 可以用 -webkit-box-pack: justify; -ms-flex-pack: justify;代替

參考justify-content

尛憇藌 回答

說(shuō)下思路吧,具體來(lái)說(shuō)route4其實(shí)是組件形式實(shí)現(xiàn)的,所以實(shí)際上每一個(gè)路由都是一個(gè)單獨(dú)的組件。

基于此,只要分出兩個(gè)大的父組件,一個(gè)包括了需要權(quán)限的,一個(gè)不包括(或者在最頂級(jí)路由包括一個(gè)需要權(quán)限驗(yàn)證的route和其他不要驗(yàn)證的同級(jí)route,用Switch做唯一對(duì)應(yīng))。

只要在需要權(quán)限的父組件的適當(dāng)生命周期里判斷當(dāng)前用戶有無(wú)權(quán)限,無(wú)則跳轉(zhuǎn)到登錄頁(yè)即可。

神曲 回答

clipboard.png
紅色框放登錄框, 并且z-index:設(shè)置的高于canvas;阻止掉登錄框部分的默認(rèn)事件;保證canvas 不會(huì)影響到登錄功能;其次就是登錄框除紅色框部分不能有元素壓蓋canvas;不然就會(huì)失去canvas的交互;
究其原因: 結(jié)構(gòu)樣式問(wèn)題;

忘了我 回答
<style>
  .flex {
    display: flex;
    flex-direction: column;
    height: 100vh
  }
  .flex-item {
    flex: 1;
    overflow: auto;
  }
</style>
<div class="flex">
  <div>top</div>
  <div class="flex-item"></div>
  <div>bottom</div>
</div>