前端
这里的前端指后台前端,采用了 vue2
+ ant design
。
后台 JS
文件位于 public/static/modules/模块名/admin/控制器名.js
,通过 requirejs
模块化加载。
define([], function() {
return {
index: { // 对应index方法
return {
template: '#app',
data: function() {
return {}
},
methods: {
}
};
}
};
});
<p>这里的前端指后台前端,采用了 <code>vue2</code> + <code>ant design</code>。<br>后台 <code>JS</code> 文件位于 <code>public/static/modules/模块名/admin/控制器名.js</code>,通过 <code>requirejs</code> 模块化加载。</p>
<pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code><span class="pln">define</span><span class="pun">([],</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span></code></li><li class="L1"><code><span class="pln"> </span><span class="kwd">return</span><span class="pln"> </span><span class="pun">{</span></code></li><li class="L2"><code><span class="pln"> index</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> </span><span class="com">// 对应index方法</span></code></li><li class="L3"><code><span class="pln"> </span><span class="kwd">return</span><span class="pln"> </span><span class="pun">{</span></code></li><li class="L4"><code><span class="pln"> </span><span class="kwd">template</span><span class="pun">:</span><span class="pln"> </span><span class="str">'#app'</span><span class="pun">,</span></code></li><li class="L5"><code><span class="pln"> data</span><span class="pun">:</span><span class="pln"> </span><span class="kwd">function</span><span class="pun">()</span><span class="pln"> </span><span class="pun">{</span></code></li><li class="L6"><code><span class="pln"> </span><span class="kwd">return</span><span class="pln"> </span><span class="pun">{}</span></code></li><li class="L7"><code><span class="pln"> </span><span class="pun">},</span></code></li><li class="L8"><code><span class="pln"> methods</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span></code></li><li class="L9"><code></code></li><li class="L0"><code><span class="pln"> </span><span class="pun">}</span></code></li><li class="L1"><code><span class="pln"> </span><span class="pun">};</span></code></li><li class="L2"><code><span class="pln"> </span><span class="pun">}</span></code></li><li class="L3"><code><span class="pln"> </span><span class="pun">};</span></code></li><li class="L4"><code><span class="pun">});</span></code></li></ol></pre>