Skip to content

Commit 8da3b83

Browse files
committed
doc: add entry/template.js how to use
1 parent 3ef1c3a commit 8da3b83

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/web/framework/entry/template.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Layout from 'component/layout/index';
22
import plugin from 'framework/plugin';
33

4+
// vue-entry-loader 自定义全局注册钩子,如果在该目录下面存在该 template.js 框架自动加载,用于注册全局的组件
45
export default function(Vue) {
56
Vue.use(plugin);
67
Vue.component(Layout.name, Layout);

app/web/framework/plugin/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default {
99
if (!Vue.prototype.hasOwnProperty('$request')) {
1010
Vue.prototype.$request = request;
1111
}
12+
// 自定义 hook 钩子,vue-entry-loader 自动加载
1213
if (!Vue.hook) {
1314
Vue.use(VueI18n);
1415
Vue.hook = {

0 commit comments

Comments
 (0)