1 | <!DOCTYPE html>
|
2 | <html lang="en">
|
3 | <head>
|
4 | <meta charset="utf-8">
|
5 | <title>JSDoc: Source: internal/init.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: internal/init.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/17.
|
31 | */
|
32 | let uid = 0;
|
33 | let viewOptions = ['data', 'el', 'events', 'methods', 'init', 'render'];
|
34 | export default function initMixin(GMP) {
|
35 | /**
|
36 | * The main init sequence. This is called for every
|
37 | * instance, including ones that are created from extended
|
38 | * constructors.
|
39 | *
|
40 | * @param {Object} options - this options object should be
|
41 | * the result of merging class
|
42 | * options and the options passed
|
43 | * in to the constructor.
|
44 | */
|
45 | GMP.prototype._init = function (options) {
|
46 | options = options || {};
|
47 |
|
48 | this._uid = uid++;
|
49 |
|
50 | _.extend(this, options);
|
51 |
|
52 | this.$options = this;
|
53 |
|
54 | ///初始化事件
|
55 | this._initEvents();
|
56 |
|
57 | this._callHook("init");
|
58 |
|
59 | // 初始化data
|
60 | this._initState();
|
61 | // 扫描模板结构
|
62 | }
|
63 | };</code></pre>
|
64 | </article>
|
65 | </section>
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | </div>
|
71 |
|
72 | <nav>
|
73 | <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="GMP.html">GMP</a></li></ul><h3>Global</h3><ul><li><a href="global.html#delegateEventSplitter">delegateEventSplitter</a></li><li><a href="global.html#uid">uid</a></li></ul>
|
74 | </nav>
|
75 |
|
76 | <br class="clear">
|
77 |
|
78 | <footer>
|
79 | Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.2</a> on Wed Oct 19 2016 10:19:24 GMT+0800 (CST)
|
80 | </footer>
|
81 |
|
82 | <script> prettyPrint(); </script>
|
83 | <script src="scripts/linenumber.js"> </script>
|
84 | </body>
|
85 | </html>
|