first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// 优势,兼容性好,所有浏览器都认识
// 但是代码复杂
(function(win,doc) {
// 用来做插件的初始化配置
function Tabs (x) {
var name = "zhangs"
if(x.hasOwnProperty("name")) {
this.name = x.name
}else {
console.error("默认参数没有填写请检查")
}
}
Tabs.prototype = {
getUserName: function() {
console.log(this.name)
}
}
win.Tabs = Tabs
})(window,document)
// es6 新的语法糖
// 一般旧的浏览器不支持
// babel 帮你把高版本的js语法转换成低版本浏览器能够认识的语法
// class Tabs{
// constructor(name) {
// this.name = name
// }
// getUserName() {
// console.log(this.name)
// }
// }