|
|
@@ -134,80 +134,82 @@ import './packages/fixednav/fixednav.scss'; // import Gesture from './packages/g
|
|
|
|
|
|
import Collapse from './packages/collapse/index.js';
|
|
|
import './packages/collapse/collapse.scss';
|
|
|
-import Luckycard from "./packages/luckycard/index.js";
|
|
|
-import "./packages/luckycard/luckycard.scss";
|
|
|
+import Luckycard from './packages/luckycard/index.js';
|
|
|
+import './packages/luckycard/luckycard.scss';
|
|
|
import NumberKeyboard from './packages/numberkeyboard/index.js';
|
|
|
import './packages/numberkeyboard/numberkeyboard.scss';
|
|
|
+import CollapseItem from './packages/collapseitem/index.js';
|
|
|
+import './packages/collapseitem/collapseitem.scss';
|
|
|
|
|
|
const packages = {
|
|
|
- Cell,
|
|
|
- Dialog,
|
|
|
- Icon,
|
|
|
- Toast,
|
|
|
- ActionSheet,
|
|
|
- Tab,
|
|
|
- TabPanel,
|
|
|
- TabBar,
|
|
|
- Calendar,
|
|
|
- DatePicker,
|
|
|
- NavBar,
|
|
|
- NoticeBar,
|
|
|
- Switch,
|
|
|
- Slider,
|
|
|
- Range,
|
|
|
- Picker,
|
|
|
- Progress,
|
|
|
- Price,
|
|
|
- Flex,
|
|
|
- Col,
|
|
|
- Row,
|
|
|
- Steps,
|
|
|
- Button,
|
|
|
- Badge,
|
|
|
- Rate,
|
|
|
- Swiper,
|
|
|
- Menu,
|
|
|
- Stepper,
|
|
|
- ButtonGroup,
|
|
|
- SearchBar,
|
|
|
- ImagePicker,
|
|
|
- Radio,
|
|
|
- RadioGroup,
|
|
|
- CheckBox,
|
|
|
- CheckBoxGroup,
|
|
|
- ShortPassword,
|
|
|
- Skeleton,
|
|
|
- Scroller,
|
|
|
- BackTop,
|
|
|
- CountDown,
|
|
|
- InfiniteLoading,
|
|
|
- Uploader,
|
|
|
- TextInput,
|
|
|
- TextBox,
|
|
|
- Avatar,
|
|
|
- Elevator,
|
|
|
- Popup,
|
|
|
- LeftSlip,
|
|
|
- TabSelect,
|
|
|
- LuckDraw,
|
|
|
- Video,
|
|
|
- Signature,
|
|
|
- CircleProgress,
|
|
|
- TimeLine,
|
|
|
- TimeLineItem,
|
|
|
- SideNavBar,
|
|
|
- SubSideNavBar,
|
|
|
- SideNavBarItem,
|
|
|
- Drag,
|
|
|
- Address,
|
|
|
- Notify,
|
|
|
- CountUp,
|
|
|
- FixedNav,
|
|
|
- // Gesture: Gesture
|
|
|
- Collapse: Collapse,
|
|
|
-
|
|
|
- Luckycard: Luckycard,
|
|
|
- NumberKeyboard: NumberKeyboard
|
|
|
+ Cell,
|
|
|
+ Dialog,
|
|
|
+ Icon,
|
|
|
+ Toast,
|
|
|
+ ActionSheet,
|
|
|
+ Tab,
|
|
|
+ TabPanel,
|
|
|
+ TabBar,
|
|
|
+ Calendar,
|
|
|
+ DatePicker,
|
|
|
+ NavBar,
|
|
|
+ NoticeBar,
|
|
|
+ Switch,
|
|
|
+ Slider,
|
|
|
+ Range,
|
|
|
+ Picker,
|
|
|
+ Progress,
|
|
|
+ Price,
|
|
|
+ Flex,
|
|
|
+ Col,
|
|
|
+ Row,
|
|
|
+ Steps,
|
|
|
+ Button,
|
|
|
+ Badge,
|
|
|
+ Rate,
|
|
|
+ Swiper,
|
|
|
+ Menu,
|
|
|
+ Stepper,
|
|
|
+ ButtonGroup,
|
|
|
+ SearchBar,
|
|
|
+ ImagePicker,
|
|
|
+ Radio,
|
|
|
+ RadioGroup,
|
|
|
+ CheckBox,
|
|
|
+ CheckBoxGroup,
|
|
|
+ ShortPassword,
|
|
|
+ Skeleton,
|
|
|
+ Scroller,
|
|
|
+ BackTop,
|
|
|
+ CountDown,
|
|
|
+ InfiniteLoading,
|
|
|
+ Uploader,
|
|
|
+ TextInput,
|
|
|
+ TextBox,
|
|
|
+ Avatar,
|
|
|
+ Elevator,
|
|
|
+ Popup,
|
|
|
+ LeftSlip,
|
|
|
+ TabSelect,
|
|
|
+ LuckDraw,
|
|
|
+ Video,
|
|
|
+ Signature,
|
|
|
+ CircleProgress,
|
|
|
+ TimeLine,
|
|
|
+ TimeLineItem,
|
|
|
+ SideNavBar,
|
|
|
+ SubSideNavBar,
|
|
|
+ SideNavBarItem,
|
|
|
+ Drag,
|
|
|
+ Address,
|
|
|
+ Notify,
|
|
|
+ CountUp,
|
|
|
+ FixedNav,
|
|
|
+ // Gesture: Gesture
|
|
|
+ Collapse: Collapse,
|
|
|
+ Luckycard: Luckycard,
|
|
|
+ NumberKeyboard: NumberKeyboard,
|
|
|
+ CollapseItem: CollapseItem
|
|
|
};
|
|
|
|
|
|
const components = {};
|
|
|
@@ -215,80 +217,80 @@ const methods = {};
|
|
|
const filters = {};
|
|
|
const directives = {};
|
|
|
pkgList.map(item => {
|
|
|
- const pkg = packages[item.name];
|
|
|
- if (!pkg) return;
|
|
|
+ const pkg = packages[item.name];
|
|
|
+ if (!pkg) return;
|
|
|
|
|
|
- if (item.type == 'component') {
|
|
|
- if (pkg.name) {
|
|
|
- components[pkg.name] = pkg;
|
|
|
- } else {
|
|
|
- for (let n in pkg) {
|
|
|
- components[n] = pkg[n];
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (item.type == 'method') {
|
|
|
- methods[item.name] = pkg;
|
|
|
- } else if (item.type == 'filter') {
|
|
|
- filters[item.name] = pkg;
|
|
|
- } else if (item.type == 'directive') {
|
|
|
- directives[item.name] = pkg;
|
|
|
+ if (item.type == 'component') {
|
|
|
+ if (pkg.name) {
|
|
|
+ components[pkg.name] = pkg;
|
|
|
+ } else {
|
|
|
+ for (let n in pkg) {
|
|
|
+ components[n] = pkg[n];
|
|
|
+ }
|
|
|
}
|
|
|
+ } else if (item.type == 'method') {
|
|
|
+ methods[item.name] = pkg;
|
|
|
+ } else if (item.type == 'filter') {
|
|
|
+ filters[item.name] = pkg;
|
|
|
+ } else if (item.type == 'directive') {
|
|
|
+ directives[item.name] = pkg;
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
const install = function(Vue, opts = {}) {
|
|
|
- if (install.installed) return;
|
|
|
+ if (install.installed) return;
|
|
|
|
|
|
- if (opts.locale) {
|
|
|
- Vue.config.lang = opts.locale;
|
|
|
- }
|
|
|
+ if (opts.locale) {
|
|
|
+ Vue.config.lang = opts.locale;
|
|
|
+ }
|
|
|
|
|
|
- if (opts.lang) locale(Vue.config.lang, opts.lang);
|
|
|
+ if (opts.lang) locale(Vue.config.lang, opts.lang);
|
|
|
|
|
|
- for (let cptName in methods) {
|
|
|
- if (Array.isArray(methods[cptName])) {
|
|
|
- Vue.prototype['$' + cptName.toLowerCase()] = methods[cptName][0];
|
|
|
- Vue.component(methods[cptName][1].name, methods[cptName][1]);
|
|
|
- } else {
|
|
|
- Vue.prototype['$' + cptName.toLowerCase()] = methods[cptName];
|
|
|
- }
|
|
|
+ for (let cptName in methods) {
|
|
|
+ if (Array.isArray(methods[cptName])) {
|
|
|
+ Vue.prototype['$' + cptName.toLowerCase()] = methods[cptName][0];
|
|
|
+ Vue.component(methods[cptName][1].name, methods[cptName][1]);
|
|
|
+ } else {
|
|
|
+ Vue.prototype['$' + cptName.toLowerCase()] = methods[cptName];
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- for (let cptName in components) {
|
|
|
- if (components[cptName] && components[cptName].name) {
|
|
|
- Vue.component(components[cptName].name, components[cptName]);
|
|
|
- }
|
|
|
+ for (let cptName in components) {
|
|
|
+ if (components[cptName] && components[cptName].name) {
|
|
|
+ Vue.component(components[cptName].name, components[cptName]);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- for (let cptName in filters) {
|
|
|
- if (filters[cptName] && filters[cptName].name) {
|
|
|
- Vue.filter(cptName, filters[cptName]);
|
|
|
- }
|
|
|
+ for (let cptName in filters) {
|
|
|
+ if (filters[cptName] && filters[cptName].name) {
|
|
|
+ Vue.filter(cptName, filters[cptName]);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- for (let cptName in directives) {
|
|
|
- if (directives[cptName] && directives[cptName].name) {
|
|
|
- Vue.directive(directives[cptName].name, directives[cptName]);
|
|
|
- }
|
|
|
+ for (let cptName in directives) {
|
|
|
+ if (directives[cptName] && directives[cptName].name) {
|
|
|
+ Vue.directive(directives[cptName].name, directives[cptName]);
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- Vue.use(Lazyload, {
|
|
|
- lazyComponent: true,
|
|
|
- loading: '//img12.360buyimg.com/imagetools/jfs/t1/73967/28/14561/916/5dc142e4E0666555b/bf33454553c6035e.png'
|
|
|
- });
|
|
|
+ Vue.use(Lazyload, {
|
|
|
+ lazyComponent: true,
|
|
|
+ loading: '//img12.360buyimg.com/imagetools/jfs/t1/73967/28/14561/916/5dc142e4E0666555b/bf33454553c6035e.png'
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
if (typeof window !== 'undefined' && window.Vue) {
|
|
|
- install(window.Vue);
|
|
|
+ install(window.Vue);
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
- version,
|
|
|
- locale,
|
|
|
- install,
|
|
|
- Lazyload,
|
|
|
- // VueQr,
|
|
|
- ...components,
|
|
|
- ...filters,
|
|
|
- ...directives,
|
|
|
- ...methods
|
|
|
-};
|
|
|
+ version,
|
|
|
+ locale,
|
|
|
+ install,
|
|
|
+ Lazyload,
|
|
|
+ // VueQr,
|
|
|
+ ...components,
|
|
|
+ ...filters,
|
|
|
+ ...directives,
|
|
|
+ ...methods
|
|
|
+};
|