Global install iView
Global install iView
This commit is contained in:
parent
7e554530a1
commit
451b52ceab
7 changed files with 771 additions and 571 deletions
|
@ -1,3 +0,0 @@
|
|||
/**
|
||||
* todo 编译.vue组件为.js文件
|
||||
*/
|
|
@ -1,12 +0,0 @@
|
|||
var compiler = require('vueify').compiler;
|
||||
var fs = require('fs');
|
||||
|
||||
var data = fs.readFileSync('../components/button/button.vue', 'utf-8');
|
||||
// console.log(data);
|
||||
|
||||
var fileContent = data;
|
||||
var filePath = '../components/button';
|
||||
compiler.compile(fileContent, filePath, function (err, result) {
|
||||
// result is a common js module string
|
||||
console.log(result);
|
||||
});
|
1298
dist/iview.js
vendored
1298
dist/iview.js
vendored
File diff suppressed because it is too large
Load diff
10
dist/iview.min.js
vendored
10
dist/iview.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
.ivu-article h1{font-size:26px;font-weight:400}.ivu-article h2{font-size:20px;font-weight:400}.ivu-article h3{font-size:16px;font-weight:400}.ivu-article h4{font-size:14px;font-weight:400}.ivu-article h5,.ivu-article h6{font-size:12px;font-weight:400}.ivu-article blockquote{padding:5px 5px 3px 10px;line-height:1.5;border-left:4px solid #ddd;margin-bottom:20px;color:#666;font-size:14px}.ivu-article ul{padding-left:40px;list-style-type:disc}.ivu-article li{margin-bottom:5px;font-size:14px}.ivu-article ol ul,.ivu-article ul ul{list-style-type:circle}.ivu-article p{margin:5px;font-size:14px}.ivu-article a[target="_blank"]:after{content:"\F220";font-family:Ionicons;color:#aaa;margin-left:2px}
|
||||
.ivu-article h1{font-size:26px;font-weight:400}.ivu-article h2{font-size:20px;font-weight:400}.ivu-article h3{font-size:16px;font-weight:400}.ivu-article h4{font-size:14px;font-weight:400}.ivu-article h5,.ivu-article h6{font-size:12px;font-weight:400}.ivu-article blockquote{padding:5px 5px 3px 10px;line-height:1.5;border-left:4px solid #ddd;margin-bottom:20px;color:#666;font-size:14px}.ivu-article ul{padding-left:40px;list-style-type:disc}.ivu-article li{margin-bottom:5px;font-size:14px}.ivu-article ol ul,.ivu-article ul ul{list-style-type:circle}.ivu-article p{margin:5px;font-size:14px}.ivu-article a[target="_blank"]:after{content:"\F220";font-family:Ionicons;color:#aaa;margin-left:3px}
|
|
@ -16,10 +16,10 @@
|
|||
"main": "dist/iview.js",
|
||||
"scripts": {
|
||||
"dev": "webpack-dev-server --content-base test/ --open --inline --hot --compress --history-api-fallback --port 8081 --config build/webpack.dev.config.js",
|
||||
"build": "gulp --gulpfile build/build-style.js",
|
||||
"dist:style": "gulp --gulpfile build/build-style.js",
|
||||
"dist:dev": "webpack --config build/webpack.dist.dev.config.js",
|
||||
"dist:prod": "webpack --config build/webpack.dist.prod.config.js",
|
||||
"dist": "npm run dist:dev && npm run dist:prod"
|
||||
"build": "npm run dist:style && npm run dist:dev && npm run dist:prod"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
11
src/index.js
11
src/index.js
|
@ -75,12 +75,17 @@ const iview = {
|
|||
const install = function (Vue) {
|
||||
Object.keys(iview).forEach((key) => {
|
||||
Vue.component(key, iview[key])
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
Vue.prototype.$Loading = LoadingBar;
|
||||
Vue.prototype.$Message = Message;
|
||||
Vue.prototype.$Modal = Modal;
|
||||
Vue.prototype.$Notice = Notice;
|
||||
};
|
||||
|
||||
// auto install
|
||||
if (typeof window !== 'undefined' && window.Vue) {
|
||||
install(window.Vue);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = Object.assign(iview, {install});
|
||||
|
|
Loading…
Add table
Reference in a new issue