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

鍍金池/ 問答/ HTML問答
慢半拍 回答

當彈出軟鍵盤時到底發(fā)生了什么? ios手機$('body').scrollTop()會改變,而android手機$(window).height()會改變彈出軟鍵盤是漸變的過程。供以下方法參考:

// ios手機
var timer = null;
$('input').on('focus', function() {
    clearInterval(timer);
    var index = 0;
    timer = setInterval(function() {
        if(index>5) {
            $('body').scrollTop(1000000);
            clearInterval(timer);
        }
        index++;
    }, 50)
})

// android手機
var winHeight = $(window).height(); // 獲取當前頁面高度  
$(window).resize(function() {  
  var resizeHeight = $(this).height();  
  if (winHeight - resizeHeight > 50) {  
      // 軟鍵盤彈出  
      $('body').css('height', winHeight + 'px');  
  } else {  
      //軟鍵盤收起
      $('body').css('height', '100%');  
  }  
});  

希望對您有所幫助!

默念 回答

圖例滾動是echarts v3.7.0新加入的功能,你的echarts需要升級到3.7.0及以上版本

clipboard.png

https://github.com/ecomfe/ech...

逗婦惱 回答

原來是我本地時間錯誤了,調整之后,就解決了~

半心人 回答

主要你是開發(fā)aps單頁面,還是CDN那種引入開發(fā),要是單頁面我,你看一下這個項目用戶中心。

擱淺 回答
  1. 讀(console.log(a.key))和寫(a.key = 1)的時候是不一樣的,讀的時候會一直查下去,寫的時候發(fā)現本身沒有就直接創(chuàng)建賦值了。
  2. new SubType()時this指向當前新創(chuàng)建的instance,所以產出為{name, colors}。那你改對colors添加name是不會影響到name屬性的。
詆毀你 回答

文件上傳的類型是multipart/formdata,一般使用multer這類的中間件處理
multer


沒什么用處的回答。。。

陌顏 回答

Student是個類型,Students是個Student類型集合的實例。

尛曖昧 回答
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script>
    function PostData() {
        $.ajax({
            type: "POST",
            url: "https://x/x.php",
            data : "data=" + $("#input_0").val(),
            success: function(msg) {
                alert(msg);
            }
        });
        return false;
    }  
</script>
<form onsubmit="return PostData()">
    <input id="input_0" type="text" value="">
    <input type="submit">
</form>  

https://x/x.php 發(fā)送一個 data=[val] 的 post 請求, [val] 是 input_0 標簽的內容, 返回的結果在 msg 里.

清夢 回答

react中可以直接用import或者require來引入圖片,然后把返回結果作為imgsrc

骨殘心 回答

得看具體配置才知道。
你可參考別人完整項目的webpack配置,總共就沒幾行代碼,一行一行分析完基本就會了。
給你個參考地址:https://github.com/CodeLittle...

爆扎 回答
昨晚找到的解決方案如下,
還有另外一種是根據url判斷,因為刷新不會改變路由(這個方法沒試過)
watch: {
      selected: function (val, oldVal) {
          router.push(val)
           window.localStorage.setItem('navTabIndex',val);
      }
  },
  created: function(){
          let localData = window.localStorage.getItem('navTabIndex')
          this.selected = localData
    }
  }
薄荷糖 回答

樣式寫在頁面內無法通過chrome的調試來修改,只能修改頁面內的樣式代碼

久愛她 回答

掛載點就是被vue 輸出替換的 dom 節(jié)點

vue 編譯打包有兩種 一種是 runtime-only 這個只能在 .vue 單頁文件能用,之后掛載的元素就會提取單頁文件里面的 html。一種就是 runtime + compiler 這個需要 template 和 render 屬性才行

絯孑氣 回答

使用react-router的createElement解決!
Router.js

......
...... // 省略其他無關緊要代碼

// 此處為要點擊刷新的組件
const arr = [
    home
];

// 開關優(yōu)化
let onOff =false;

// 頁面強制刷新,如果需要強制刷新在路由中添加onChange事件以及在組件數組添加
const createElement=(component, props) =>{
    if (props.children && onOff || props.children && arr.includes(props.routes.slice(-1)[0].getComponent)) {
        let children = Object.assign({}, props.children, {key : `${window.location.pathname}` + new Date().getTime()})
        props = { ...props, children };
        onOff = false;
    }
    return React.createElement(component, props)
}

const onChange = (props, next) => {
    onOff = true
    console.log(`${next.location.pathname}`, 'change');
}

const RouteConfig = (
    <Router history={history} createElement = {createElement}>
        <Route path="/home" getComponent={home} onChange = {onChange} />
        ...
        ...
    </Router>
);

export default RouteConfig;

如果您用的react-router4.0,當使用 component 時,router 將使用 React.createElement 根據給定的 component 創(chuàng)建一個新的 React 元素。這意味著如果你使用內聯函數(inline function)傳值給 component將會產生不必要的重復裝載。對于內聯渲染(inline rendering), 建議使用 renderprop。
也可以參考下我新寫的文章:這里有沒有你想要的react-router

氕氘氚 回答

1.上傳完圖片調回到頁面上,或者用FileReader()把本地要上傳的圖像文件變成DataUrl直接在頁面上展現

var input = document.getElementById("inputArea")
var imgData = input.files[0];
var reader = new FileReader(); //調用FileReader對象
reader.readAsDataURL(imgData); //通過DataURL的方式返回圖像
reader.onload = function(e) {
    var result = document.getElementById("result");
    result.innerHTML = '<img src="' + e.target.result + '" alt="" />';
}

2.將圖片和你要渲染出的文字用html排版成你想要的樣子
3.用html2canvas庫將你的頁面渲染成圖片就OK了

html2canvas(document.getElementById('image'), {
    onrendered: function(canvas) {
        var image = canvas.toDataURL("image/png");  
        $("#pic").html("<img src='"+image+"' alt='from canvas'/>")
    },
});
浪婳 回答

不要想太多細節(jié)上的開銷,這也是新手常常犯的錯誤。先把大局上的架構優(yōu)化弄明白才是正道

局外人 回答
body{
    zoom:0.8;
}

或者

body{
    transform: scale(0.8);
}
冷眸 回答

信息太少。請給出更多代碼

不將就 回答

先說一下我的問題吧,以下是我的目錄結構(以下用test命名的文件/文件夾就是此次測試所用)

圖片描述

這個是一開始的webpack配置
圖片描述
圖片描述

這個是在sass中引用到的圖片
圖片描述

我希望的是打包后,src/img/test/test.png能夠變成dist/img/test/test.png,然而,當我打包之后,卻發(fā)現變成了這樣子
圖片描述
圖片描述

圖片直接打包到了dist/img目錄之下,并且css之中引用的也是dist/css/img下的圖片,沒辦法,看文檔,結果我看到了這一句圖片描述

我尋思著,這應該就是對應目錄的配置了吧(原諒我理解有問題),趕緊寫上去,結果是這樣

圖片描述

毛線啊,只不過是多了個src的相對路徑啊,問題根本沒變啊
之后還是到了找資料的過程,發(fā)現publicPath這個東西,
圖片描述

重點來了,publicPath說是自定義發(fā)布的目錄,其實就是將你打包后的css中引用的文件路徑給替換成publicPath的值,并且因為publicPath與name這兩個屬性可以是函數,并且兩者有一定的聯系,所以我們可以從這里下文章。

{
            test: /\.(png|jpg)$/,
            use: {
                loader: "url-loader",
                options:{
                    name: function(file){
                        console.log('----------111-------',file);
                    },
                    // name: '[name].[ext]',
                    limit: '8192',
                    publicPath: function(url){
                        console.log('----------222-------',url)
                    },
                    outputPath: 'img/',
                }
            }
        }

當然,這樣子打包的是不完整的,打包后的圖片也是直接就在dist/img文件夾下,我們需要的是看看參數file與url是什么
圖片描述

一次是看不出什么的,我們再來一次

{
            test: /\.(png|jpg)$/,
            use: {
                loader: "url-loader",
                options:{
                    name: function(file){
                        console.log('----------111-------',file);
                        return 'QAQ/[name].[ext]'
                    },
                    // name: '[path][name].[ext]',
                    limit: '8192',
                    publicPath: function(url){
                        console.log('----------222-------',url)
                    },
                    outputPath: 'img/',
                }
            }
        }

圖片描述

emm,dist/img文件夾下多了個QAQ,file是引用圖片的絕對路徑,并且url就是這個name函數返回的值(我們假裝它是真的QAQ/test.png),那么接下來我們就可以繼續(xù)進行下一步

{
            test: /\.(png|jpg)$/,
            use: {
                loader: "url-loader",
                options:{
                    name: function(file){
                        var reg = /img\\(.*)\\([^\\]*)\.(png|jpg)$/,
                        dirStr = reg.exec(file)[1]
                        dirStr = dirStr?dirStr.replace(/\\/g,'/')+'/':''; 
                        return dirStr + '[name].[ext]'
                    },
                    // name: '[path][name].[ext]',
                    limit: '8192',
                    publicPath: function(url){
                        return path.resolve(__dirname,'dist/img',url).replace(/\\/g,'/')
                    },
                    outputPath: 'img/',
                }
            }
        }

在name這邊我使用了正則好從file中提取出對應的文件夾比如'QAQ/',拼合成打包圖片的路徑返回,這樣子根據圖片生產對應的文件夾這個問題就解決了,然后在publicPath這邊根據傳進來的url進行路徑拼接,得到打包后的圖片位置,并返回出去,結果如下圖
圖片描述
可以看到這已經得到了我預期的效果,并且打包后的css中圖片引用路徑也是沒問題的。
希望這個能給樓主提供一些幫助,另外如果有錯誤的話還請各位指出,畢竟第一次寫東西語言有點混亂(躺)