File tree 5 files changed +42
-11
lines changed
packages/@vuepress/core/lib/app
5 files changed +42
-11
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { siteData } from '@internal/siteData'
7
7
import appEnhancers from '@internal/app-enhancers'
8
8
import globalUIComponents from '@internal/global-ui'
9
9
import ClientComputedMixin from '@transform/ClientComputedMixin'
10
- import Store from './plugins/Store '
10
+ import VuePress from './plugins/VuePress '
11
11
12
12
// built-in components
13
13
import LoadableContent from './components/Content.vue'
@@ -32,7 +32,7 @@ if (module.hot) {
32
32
Vue . config . productionTip = false
33
33
34
34
Vue . use ( Router )
35
- Vue . use ( Store , '$vuepress' )
35
+ Vue . use ( VuePress )
36
36
// mixin for exposing $site and $page
37
37
Vue . mixin ( dataMixin ( ClientComputedMixin , siteData ) )
38
38
// component for rendering markdown content and setting title etc.
Original file line number Diff line number Diff line change
1
+ import Vue from 'Vue'
2
+
3
+ export declare class Store {
4
+ store : Vue ;
5
+
6
+ $get ( key : string ) : any ;
7
+
8
+ $set ( key : string , value : any ) : void ;
9
+
10
+ $emit : typeof Vue . prototype . $emit ;
11
+
12
+ $on : typeof Vue . prototype . $on ;
13
+ }
14
+
15
+
Original file line number Diff line number Diff line change 1
1
import Vue from 'vue'
2
2
3
- class Store {
3
+ export default class Store {
4
4
constructor ( ) {
5
5
this . store = new Vue ( {
6
6
data : {
@@ -25,11 +25,3 @@ class Store {
25
25
this . store . $on ( ...args )
26
26
}
27
27
}
28
-
29
- export default {
30
- install ( Vue , options = '$store' ) {
31
- const store = new Store ( )
32
- Vue [ options ] = store
33
- Vue . prototype [ options ] = store
34
- }
35
- }
Original file line number Diff line number Diff line change
1
+ import { Store } from './Store' ;
2
+
3
+ declare class VuePress extends Store {
4
+
5
+ }
6
+
7
+ declare module "vue/types/vue" {
8
+ interface Vue {
9
+ $vuepress : Store ;
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ import Store from './Store'
2
+
3
+ class VuePress extends Store {
4
+
5
+ }
6
+
7
+ export default {
8
+ install ( Vue ) {
9
+ const store = new VuePress ( )
10
+ Vue . $vuepress = store
11
+ Vue . prototype . $vuepress = store
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments