侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

requirejs 和 prototype 及 公共属性的调用

2024-05-08 星期三 / 0 评论 / 0 点赞 / 58 阅读 / 698 字

requirejs.config({//baseUrl:'js/lib',path:{jquery:'jquery'}})requirejs(['jquery'],function($){// con

requirejs.config({	//baseUrl:'js/lib',	path:{		jquery:'jquery'	}})requirejs(['jquery'],function($){	// console.log($)	function Helloword(el,opts){		this.opts = $.extend({},Helloword.DEFAULTS,opts);		this.el = $(el);	}	Helloword.DEFAULTS = {		name:'xiaiang',		age:18+ '岁',		address:'惠州'	}	Helloword.prototype.name = function(){		var opts = this.opts;		console.log(opts.name);	}	Helloword.prototype.age = function(){		var opts = this.opts;		var $el =this.$el;		console.log(opts.name);	}	new Helloword().name();	new Helloword().age($('.test'),{		name:'mei',		age:16+ '岁',		address:'惠州2'	});})

 

广告 广告

评论区