1 | <!DOCTYPE html>
|
2 | <html lang="en">
|
3 | <head>
|
4 | <meta charset="utf-8">
|
5 | <title>JSDoc: Source: jsframework/core/gmp.js</title>
|
6 |
|
7 | <script src="scripts/prettify/prettify.js"> </script>
|
8 | <script src="scripts/prettify/lang-css.js"> </script>
|
9 | |
10 |
|
11 |
|
12 | <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
13 | <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
14 | </head>
|
15 |
|
16 | <body>
|
17 |
|
18 | <div id="main">
|
19 |
|
20 | <h1 class="page-title">Source: jsframework/core/gmp.js</h1>
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | <section>
|
28 | <article>
|
29 | <pre class="prettyprint source linenums"><code>/**
|
30 | * Created by zhangmike on 16/10/14.
|
31 | */
|
32 | import initMixin from './internal/init';
|
33 | import initEvents from './internal/events';
|
34 | import initState from './internal/state';
|
35 | import initEventBus from './events/eventbus';
|
36 | import gmpx from './data/data';
|
37 | import extend from './inherits/extend';
|
38 | /**
|
39 | * The exposed GMP constructor.
|
40 | *
|
41 | * @constructor
|
42 | * @param {Object} [options]
|
43 | * @public
|
44 | * @example
|
45 | * new GMP({
|
46 | * data: '123',
|
47 | * methods: {
|
48 | * login: function () {
|
49 | *
|
50 | * }
|
51 | * }
|
52 | * })
|
53 | */
|
54 | class GMP {
|
55 | constructor(options) {
|
56 | this._init(options);
|
57 | }
|
58 | static $() {
|
59 | if (window.$) return window.$;
|
60 | throw new Error('GMP need jQuery or Zepto in window scope named $');
|
61 | }
|
62 | static _assignPros(pros){
|
63 | Object.assign(GMP.prototype,pros);
|
64 | }
|
65 | }
|
66 |
|
67 | // 初始化属性
|
68 | initMixin(GMP);
|
69 | //初始化事件
|
70 | initEvents(GMP);
|
71 | //初始化数据
|
72 | initState(GMP);
|
73 | //初始化事件BUS
|
74 | initEventBus(GMP);
|
75 |
|
76 | GMP.GMPX = gmpx;
|
77 | GMP.extend = extend;
|
78 | export default GMP;
|
79 | </code></pre>
|
80 | </article>
|
81 | </section>
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | </div>
|
87 |
|
88 | <nav>
|
89 | <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="global.html#GMP">GMP</a></li><li><a href="module.html#.exports">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#isType">isType</a></li><li><a href="global.html#uid">uid</a></li></ul>
|
90 | </nav>
|
91 |
|
92 | <br class="clear">
|
93 |
|
94 | <footer>
|
95 | Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Mon Oct 24 2016 18:10:18 GMT+0800 (CST)
|
96 | </footer>
|
97 |
|
98 | <script> prettyPrint(); </script>
|
99 | <script src="scripts/linenumber.js"> </script>
|
100 | </body>
|
101 | </html>
|