Comparing version 1.0.1 to 1.0.2
45
index.js
@@ -1,32 +0,12 @@ | ||
import LogReg from '../packages/LogReg/index.js'; | ||
import Logreg from './packages/logreg/index.js'; | ||
const components = [ | ||
LogReg | ||
Logreg | ||
]; | ||
const install = function(Vue, opts = {}) { | ||
locale.use(opts.locale); | ||
locale.i18n(opts.i18n); | ||
components.map(component => { | ||
Vue.component(component.name, component); | ||
}); | ||
Vue.use(Loading.directive); | ||
const ELEMENT = {}; | ||
ELEMENT.size = opts.size || ''; | ||
Vue.prototype.$loading = Loading.service; | ||
Vue.prototype.$msgbox = MessageBox; | ||
Vue.prototype.$alert = MessageBox.alert; | ||
Vue.prototype.$confirm = MessageBox.confirm; | ||
Vue.prototype.$prompt = MessageBox.prompt; | ||
Vue.prototype.$notify = Notification; | ||
Vue.prototype.$message = Message; | ||
Vue.prototype.$ELEMENT = ELEMENT; | ||
}; | ||
/* istanbul ignore if */ | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
@@ -36,13 +16,12 @@ install(window.Vue); | ||
module.exports = { | ||
version: '1.0.0', | ||
locale: locale.use, | ||
i18n: locale.i18n, | ||
install, | ||
CollapseTransition, | ||
Loading, | ||
Pagination, | ||
Dialog, | ||
}; | ||
export default{ | ||
version:'1.0.1', | ||
install | ||
} | ||
module.exports.default = module.exports; | ||
// module.exports = { | ||
// version: '1.0.1', | ||
// install | ||
// }; | ||
// | ||
// module.exports.default = module.exports; |
{ | ||
"name": "fzm-ui", | ||
"version": "1.0.1", | ||
"description": "", | ||
"version": "1.0.2", | ||
"main": "index.js", | ||
@@ -10,3 +9,12 @@ "scripts": { | ||
"author": "ygg", | ||
"license": "ISC" | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/yegao/fzm-ui.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/yegao/fzm-ui/issues" | ||
}, | ||
"homepage": "https://github.com/yegao/fzm-ui#readme", | ||
"description": "" | ||
} |
@@ -1,72 +0,12 @@ | ||
export default { | ||
install: function (Vue, options) { | ||
// 1. 添加全局方法或属性 | ||
// 略 | ||
import FzmLogReg from './src/logreg' | ||
FzmLogReg.install = function (Vue) { | ||
Vue.component(FzmLogReg.name,FzmLogReg) | ||
// 添加全局方法或属性 | ||
// 2. 添加全局资源 | ||
// 时间格式化过滤器,输入内容是number或者Date对象,输出是YYYY-MM-DD HH-MM-SS | ||
Vue.filter('formatTime', function (value) { | ||
Date.prototype.Format = function (fmt) { //author: meizz | ||
var o = { | ||
"M+": this.getMonth() + 1, //月份 | ||
"d+": this.getDate(), //日 | ||
"h+": this.getHours(), //小时 | ||
"m+": this.getMinutes(), //分 | ||
"s+": this.getSeconds(), //秒 | ||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度 | ||
"S": this.getMilliseconds() //毫秒 | ||
}; | ||
if (/(y+)/.test(fmt)) | ||
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); | ||
for (var k in o) | ||
if (new RegExp("(" + k + ")").test(fmt)) | ||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); | ||
return fmt; | ||
} | ||
return new Date(value).Format("yyyy-MM-dd hh:mm:ss"); | ||
}) | ||
// 添加全局过滤器 Vue.filter() | ||
// 2. 添加全局资源 | ||
// 添加注入组件时,是否利用console.log来通知的判断条件,也是组件实例属性 | ||
Vue.prototype.NOTICE = true; | ||
// 注入组件 Vue.mixin() | ||
// 3. 注入组件 | ||
// 注入组件,插件加载开始前提示 | ||
Vue.mixin({ | ||
created: function () { | ||
if (this.NOTICE) | ||
console.log("组件开始加载") | ||
}, | ||
methods: { | ||
test: function () { | ||
console.log("mixin test"); | ||
} | ||
} | ||
}) | ||
// 4. 添加实例方法 | ||
// 返回数字是输入数字的两倍,如果不是数字或者不能隐式转换为数字,则输出null | ||
// 组件实例方法 | ||
Vue.prototype.doubleNumber = function (val) { | ||
if (typeof val === 'number') { | ||
return val * 2; | ||
} else if (!isNaN(Number(val))) { | ||
return Number(val) * 2; | ||
} else { | ||
return null | ||
} | ||
} | ||
// 4. 添加实例方法 | ||
// 服务组,将实例方法整合到$service中,避免命名冲突 | ||
Vue.prototype.$service = { | ||
//电话号码合法性检查 | ||
telNumberCheck: function (tel) { | ||
var pattern = /(^(([0\+]\d{2,3}-)?(0\d{2,3})-)(\d{7,8})(-(\d{3,}))?$)|(^0{0,1}1[3|4|5|6|7|8|9][0-9]{9}$)/; | ||
return pattern.test(tel) | ||
} | ||
} | ||
} | ||
}; | ||
// 添加实例方法 Vue.prototype | ||
} | ||
export default FzmLogReg; |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
1
1
0
19781
10
62