說明這個(gè)組件有可能沒有被掛載啊- -
上傳失敗了以后那個(gè)list里面還有嗎
import "~@/xxxx"
webstorm:
1.設(shè)置里Editor=>Code Style=>Live Templates自己按需求設(shè)置,for(itar),for..of(iter),for..in(itin)已經(jīng)自帶了,直接簡寫+TAB就好了
2.自動(dòng)文檔啥意思,自動(dòng)跳轉(zhuǎn)文檔嗎,ctrl+q 有些帶上箭頭的可以跳轉(zhuǎn)外部網(wǎng)站
vscode:
1.命令I(lǐng)nsert Snippet,選擇需要的,自定義在首選項(xiàng)=>用戶代碼片段里
2.沒用過
我剛才試了一下是可以的啊。。。
Observable.fromEvent(window, "resize")
.debounceTime(100)
.subscribe((event: any) => console.warn(event.target.innerWidth));
你再檢查一下是不是哪里代碼寫的有問題?
看文檔
<template slot-scope="scope">{{ scope.row }}</template>
怎樣做到線程安全,其實(shí)只要在編寫類的時(shí)候處理好線程安全性就可以了,使用這個(gè)類的時(shí)候就不用擔(dān)心什么。如果一個(gè)類已知是線程不安全的(例如 StringBuilder),那么就限制它只在當(dāng)前方法里面使用即可。
如果實(shí)在找不到好的方法可以先銷毀再初始化。
$(".box li").on('click', function () {
var val = $(this).text();
var cs = $(this).find('a').attr('class');
city=cs;
mapEcharts.dispose();
mapEcharts = echarts.init(dom);
bigdata.zkAjax();
bigdata.mapAjax();
$(".citys").text(val);
// $(".box").hide();
})
另外切換的時(shí)候會(huì)出現(xiàn)下面這種情況
偶發(fā)的bug,切換到成都的時(shí)候出現(xiàn)概率較大
1、/^[0-9a-z_]{5,20}$/.test(username)
2、/^d{9,32}$|^(?!\d+$)[0-9a-zA-Z]{6,32}$/.test(password)
格式問題,用int轉(zhuǎn)一下試試
看日志唄,找到崩潰的原因
=> 是es6中的箭頭函數(shù), 與普通函數(shù)不同的是它可以綁定當(dāng)前上下文
詳見 https://developer.mozilla.org...
getHeroes(): void {
this.heroService.getHeroes()
.subscribe(heroes => this.heroes = heroes);
}
分解開等同于
getHeroes(): void {
var _this = this;
this.heroService.getHeroes()
.subscribe(function(heroes) {
_this.heroes = heroes;
});
}但我把mounted改成created的時(shí)候會(huì)報(bào)Cannot read property 'appendChild' of null"
這是因?yàn)閏reated的時(shí)候,Dom節(jié)點(diǎn)還沒有渲染出來到頁面上,這個(gè)時(shí)候是找不到id=wave的DIV的。
改成Vue的插件
import wavePng from './wave.png'
export default {
install(Vue){
Vue.directive('wave', {
inserted: function(el){
start(el)
}
})
}
}
var ctx;
var waveImage;
var canvasWidth;
var canvasHeight;
var needAnimate = false;
function init (callback, wave) {
// var wave = document.getElementById('wave');
var canvas = document.createElement('canvas');
if (!canvas.getContext) return;
ctx = canvas.getContext('2d');
canvasWidth = wave.offsetWidth;
canvasHeight = wave.offsetHeight;
canvas.setAttribute('width', canvasWidth);
canvas.setAttribute('height', canvasHeight);
wave.appendChild(canvas);
waveImage = new Image();
waveImage.onload = function () {
console.log('000')
waveImage.onload = null;
callback(wave);
}
waveImage.src = wavePng;
}
function animate () {
var waveX = 0;
var waveY = 0;
var waveX_min = -203;
var waveY_max = canvasHeight * 0.7;
var requestAnimationFrame =
window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) { window.setTimeout(callback, 1000 / 60); };
function loop () {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
if (!needAnimate) return;
if (waveY < waveY_max) waveY += 1.5;
if (waveX < waveX_min) waveX = 0; else waveX -= 3;
ctx.globalCompositeOperation = 'source-over';
ctx.beginPath();
ctx.arc(canvasWidth/2, canvasHeight/2, canvasHeight/2, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
ctx.globalCompositeOperation = 'source-in';
ctx.drawImage(waveImage, waveX, canvasHeight - waveY);
requestAnimationFrame(loop);
}
loop();
}
function start (el) {
console.log(1)
if (!ctx) return init(start, el);
needAnimate = true;
setTimeout(function () {
if (needAnimate) animate();
}, 500);
}
function stop () {
needAnimate = false;
}
上述的代碼,把原先插件的閉包去掉了,因?yàn)檫@個(gè)改成vue的插件webpack打包完本身就是一個(gè)閉包了。
然后使用的話,就用指令的形式
<template>
<div id="wave" class="wave" v-wave><span>60%</span></div>
</template>
<script>
import wave from './a'
export default {
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.wave{width:200px;height:200px;overflow:hidden;border-radius:50%;background:rgba(255,203,103,.6);margin:100px auto;position:relative;text-align:center;display:table-cell;vertical-align:middle;}
.wave span{display:inline-block;color:#fff;font-size:20px;position:relative;z-index:2;}
.wave canvas{position:absolute;left:0;top:0;z-index:1;}
</style>
main.js
import Vue from 'vue'
import App from './App'
import router from './router'
import wave from './components/a'
Vue.config.productionTip = false
Vue.use(wave)
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
這樣就可以了。
有點(diǎn)沒明白你想干啥?是要彈出一個(gè)提示信息么?不知道這個(gè)能不能幫上你
/**
* 由于ios10 和 ios11 版本之間的差異,所以先判斷ios系統(tǒng)版本之后再做處理
*/
let str = navigator.userAgent.toLowerCase();
let ver = str.match(/cpu iphone os (.*?) like mac os/)[1].replace(/_/g,".");
let oc = ver.split('.')[0];
if(oc > 10){
// ios11 不做處理
return true;
}else{
this.timer = setInterval(function() {
console.log('輸入框獲取到焦點(diǎn)');
document.body.scrollTop = document.body.scrollHeight;
}, 200);
}-moz-overflow:scrollbars-none
不是這樣寫的嗎?
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國制造2025”,實(shí)現(xiàn)中華民族偉大復(fù)興的升級(jí)產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。