這個(gè)彈幕滾動(dòng)的動(dòng)畫(huà)效果一般都是定時(shí)函數(shù)setInterval做的,當(dāng)你停下的時(shí)候就cleanInterval就行了,
動(dòng)畫(huà)函數(shù)的內(nèi)容類(lèi)似輪播,滾動(dòng)播放那些插件的內(nèi)容,修改的都是當(dāng)前字幕的dom對(duì)象樣式,所以刪除定時(shí)的時(shí)候彈幕就停下了
是...constructor
代碼亂七八糟的。
js 里沒(méi)有大數(shù)字。超過(guò) 整數(shù)就是浮點(diǎn)數(shù)。浮點(diǎn)不精確。
php有bcmath,你要算就全用 bcmath 來(lái)算,中間有個(gè)整數(shù)與&,和位移<<,是怎么回事?
layer.js很多彈出樣式
使用數(shù)組解構(gòu)似乎更方便。
let [, {children: [{children}]}] = json
let index = children.findIndex(obj => obj.name === 'a1')
children[0].expand = true
是不是很簡(jiǎn)單,捂臉逃走。
可以看下這篇文章,大概意思是命名函數(shù)表達(dá)式NFE的名字是存在一個(gè)輔助特殊對(duì)象(auxiliary special object)中的,而且是只讀的,所以在非嚴(yán)格模式下修改會(huì)靜默失敗,如果這段函數(shù)內(nèi)部在嚴(yán)格模式下運(yùn)行會(huì)報(bào)錯(cuò)Uncaught TypeError: Assignment to constant variable.
,其他答案中說(shuō)的c被定義成全局是不對(duì)的,可以試一下把console.log(c)
改成console.log(window.c)
也是undefined
。
使用計(jì)算屬性
因?yàn)槟忝疤?hào)前面多了一個(gè)空格
border-radius:3px
你是說(shuō)event.target可能是title
和sub
?
如果是這個(gè)意思的話(huà),這跟vue和jquery都沒(méi)關(guān)系。
取綁定事件的元素的話(huà)是用event.currentTarget
自己看,別用self,跟vue沒(méi)關(guān)系,就是event.target
和event.currentTarget
的區(qū)別
直接在子組件內(nèi)connect
寫(xiě)了自定義規(guī)則,前面兩個(gè)就不要了,也不要message了:
productTitle: [
{ validator: (rule, value, callback)=>{
if(!value){
callback(new Error('請(qǐng)?zhí)顚?xiě)商品標(biāo)題'))
}
if(value.length>25){
callback(new Error('商品標(biāo)題最多不超過(guò)25個(gè)'))
}
callback()
}, trigger: ['change', 'blur'] }
]
直接寫(xiě)成絕對(duì)路徑便可:/static/img/head.PNG
解決方法:
1、轉(zhuǎn)換思路,左邊放echarts圖,右邊放一個(gè)獨(dú)立的div
2、在echarts的配置里面,作出以下修改:
修改一下legend組件的配置,添加定位
session可以存數(shù)組的,沒(méi)登錄你就先給他扔session里面,離開(kāi)頁(yè)面就消失了;如果登錄了你就把他同步到登錄的這個(gè)人的信息里面
這些基本都是模塊化方案,實(shí)際上自己頁(yè)很容易寫(xiě)出模塊化的原理
如webpack
(function(modulesArr) {
var rootModule = {};
function __require__(id) {
if (rootModule[id]) {
return rootModule[id].exports;
}
var currentModule = modulesArr[id];
var module = {
id,
exports: {}
};
currentModule.call(module.exports, module.exports, module, __require__);
currentModule[id] = module;
return module.exports;
}
return __require__(0);
})([
function(exports, module, require) {
var m1 = require(1);
console.log(m1);
},
function(exports, module, require) {
exports.msg = 'Hello World';
var m2 = require(2);
m2();
},
function(exports, module, require) {
module.exports = function() {
var str = 'Hello World';
console.log(str);
return str;
};
}
]);
我自己實(shí)現(xiàn)的browser端模塊化
(function(global) {
'use strict';
var errMsg = Math.random().toString(32).substr(2);
var rootModule = {};
function ModuleCtor(id) {
if (!this || this.__proto__ !== ModuleCtor.prototype) {
return new ModuleCtor(id);
}
this.id = id;
this.exports = {};
this.loaded = !1;
}
function define(id, fn) {
if (typeof id === 'function') {
fn = id;
id = document.currentScript
? document.currentScript.src
: Math.random()
.toString(32)
.substr(2);
}
if (typeof id !== 'string') {
id = '' + id;
}
var module = ModuleCtor(id);
exec();
function __require__(src) {
if (rootModule[src] && rootModule[src].__proto__ === ModuleCtor.prototype) {
return rootModule[src].exports;
}
loadScript(src, function() {
exec();
});
throw new Error(errMsg);
}
function exec() {
try {
fn.call(module.exports, module.exports, module, __require__);
module.loaded = !0;
rootModule[id] = module;
} catch (err) {
if (err.message !== errMsg) {
throw err;
}
}
}
}
function loadScript(src, callback) {
var script = document.createElement('script');
script.src = src;
script.onload = function() {
callback && callback(src);
};
document.body.appendChild(script);
return script;
}
global.define = define;
})(window);
本質(zhì)都是js沒(méi)有模塊,所以我們就想到全局暴露一個(gè)rootModule對(duì)象,每一個(gè)鍵都是一個(gè)模塊,exports對(duì)象是依賴(lài)的暴露。
如a.js
module.exports = 'Hello World';
b.js
var chars = require('./a');
process.stdout.write(chars + '\n'); // Hello World
但是我們?cè)趺磳?shí)現(xiàn)呢,(一)編譯:如webpack,(二)暴露一個(gè)函數(shù),如requirejs、seajs。
webpack 可以配置 output libraryTarget: 'umd', library: 'globalVarName' 打題主說(shuō)的這種umd包,兼容瀏覽器,requirejs,node環(huán)境。
另外我還是忍不住吐槽一下seajs的垃圾,一個(gè)文件的多個(gè)require發(fā)請(qǐng)求時(shí)沒(méi)有順序之分,字符串正則來(lái)分析依賴(lài)。。。如果jQuery的plugin依賴(lài)jQuery,需要對(duì)jQueryplugin改一下代碼討個(gè)套個(gè)客,不能直接想requirejs直接在config中聲明依賴(lài)。垃圾。當(dāng)然我自己寫(xiě)的模塊加載更垃圾,連依賴(lài)都不分析。多try幾次必然成功。
SEO
可以通過(guò)ua
返回一個(gè)完整頁(yè)面,不是太大的問(wèn)題。node
上做,后端變更也只需要同時(shí)更新node
服務(wù)。看到樓下的回答想起了耗子老師的一篇文章分布式系統(tǒng)架構(gòu)的冰與火
問(wèn)題3的邏輯大致相同
改變前端pug、less、js文件后,怎么自動(dòng)刷新前端頁(yè)面?
gulp
監(jiān)控文件,gulp-nodemon
做后端自動(dòng)重啟,gulp-livereload
做前端的自動(dòng)更新。北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專(zhuān)業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(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ū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。