File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,27 @@ import cloneDeep from 'lodash/cloneDeep'
55
66function createLocalVue ( ) : Component {
77 const instance = Vue . extend ( )
8- instance . version = Vue . version
9- instance . _installedPlugins = [ ]
8+
9+ // clone global APIs
10+ Object . keys ( Vue ) . forEach ( key => {
11+ if ( ! instance . hasOwnProperty ( key ) ) {
12+ instance [ key ] = cloneDeep ( Vue [ key ] )
13+ }
14+ } )
15+
16+ // config is not enumerable
1017 instance . config = cloneDeep ( Vue . config )
11- instance . util = cloneDeep ( Vue . util )
12- instance . _use = instance . use
18+
19+ // option merge strategies need to be exposed by reference
20+ // so that merge strats registered by plguins can work properly
21+ instance . config . optionMergeStrategies = Vue . config . optionMergeStrategies
22+
23+ const use = instance . use
1324 instance . use = ( plugin ) => {
25+ // compat for vue-router < 2.7.1
1426 plugin . installed = false
1527 plugin . install . installed = false
16- instance . _use ( plugin )
28+ use . call ( instance , plugin )
1729 }
1830 return instance
1931}
You can’t perform that action at this time.
0 commit comments