摘要:最近在學(xué)習(xí)發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。
最近在學(xué)習(xí)extjs4發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。
現(xiàn)提供可以調(diào)試的代碼:
html文件很簡(jiǎn)單,就引入ext資源和自定義的js文件就可以了。
測(cè)試配置
js文件就是定義了2個(gè)類,一個(gè)window,一個(gè)bottomBar,其中window中包含bottomBar對(duì)象,具體代碼如下:
/** * Created by catcher on 2016-3-30. */ Ext.define("My.own.Window",{ /** @readonly */ isWindow:true, config:{ title:"This title", bottomBar:{ enable:false, height:10, resizable:false } }, constructor:function(config){ this.initConfig(config); return this; }, applyTitle:function(title){ if(!Ext.isString(title)||title.length==0){ alert("Error: Title must be a valid non-empty string!"); }else{ return title; } }, applyBottomBar:function(bottomBar){ if(bottomBar && bottomBar.enable){ if(!this.bottomBar){ return Ext.create("My.own.WindowBottomBar",bottomBar); }else{ this.bottomBar.setConfig(bottomBar); } } } }); Ext.define("My.own.WindowBottomBar",{ config:{ enable:true, height:10, resizable:false }, constructor:function(config){ this.initConfig(config); return this; } }); var myWindow = Ext.create("My.own.Window", { title: "Hello World", bottomBar: { enable: true, height: 60, resizable: true } }); console.log(myWindow.getTitle()); // "Hello World" myWindow.setTitle("Something New"); console.log(myWindow.getTitle()); // "Something New" myWindow.setTitle(null); // alerts "Error: Title must be a valid non-empty string!" console.log(myWindow.getBottomBar().getHeight()); myWindow.setBottomBar({enable:true,height:100}); // Bottom bar"s height is changed to 100 console.log(myWindow.getBottomBar().getHeight());
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://m.hztianpu.com/yun/86747.html
摘要:最近在學(xué)習(xí)發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。 最近在學(xué)習(xí)extjs4發(fā)現(xiàn)一篇文章中有錯(cuò)誤,網(wǎng)上很多人都是直接復(fù)制粘貼那篇文章,結(jié)果每個(gè)人注釋中都是寫的正確的答案,我也是醉了,這些猿么復(fù)制粘貼代碼都不帶檢查的么,為啥都變得很浮躁了呢。 現(xiàn)提供可以調(diào)試的代碼: ...
摘要:學(xué)習(xí)之道簡(jiǎn)體中文版通往實(shí)戰(zhàn)大師之旅掌握最簡(jiǎn)單,且最實(shí)用的教程。前言學(xué)習(xí)之道這本書使用路線圖中的精華部分用于傳授,并將其融入一個(gè)獨(dú)具吸引力的真實(shí)世界的具體代碼實(shí)現(xiàn)。完美展現(xiàn)了的優(yōu)雅。膜拜的學(xué)習(xí)之道是必讀的一本書。 《React 學(xué)習(xí)之道》The Road to learn React (簡(jiǎn)體中文版) 通往 React 實(shí)戰(zhàn)大師之旅:掌握 React 最簡(jiǎn)單,且最實(shí)用的教程。 showIm...
摘要:前言設(shè)置項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)做一些對(duì)應(yīng)的重寫配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)。 前言 設(shè)置laravel項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)nginx做一些對(duì)應(yīng)的重寫rewrite配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)404。 nginx.conf配置 server { listen 80; server_name xxx.com; #域名 root /data/www...
摘要:前言設(shè)置項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)做一些對(duì)應(yīng)的重寫配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)。 前言 設(shè)置laravel項(xiàng)目的域名站點(diǎn)的時(shí)候,需要對(duì)nginx做一些對(duì)應(yīng)的重寫rewrite配置,用來(lái)做相關(guān)路由,否則會(huì)報(bào)404。 nginx.conf配置 server { listen 80; server_name xxx.com; #域名 root /data/www...
閱讀 924·2021-11-25 09:43
閱讀 3742·2021-11-19 09:40
閱讀 968·2021-09-29 09:34
閱讀 1898·2021-09-26 10:21
閱讀 938·2021-09-22 15:24
閱讀 4296·2021-09-22 15:08
閱讀 3325·2021-09-07 09:58
閱讀 2836·2019-08-30 15:55