Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit ada2673

Browse files
committed
feat(index): support automatically install for standalone
1 parent 6fd543e commit ada2673

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/index.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import extend from './extend'
22

33

44
/**
5-
* plugin
5+
* install
66
*
77
* @param {Object} Vue
88
* @param {Object} opts
99
*/
1010

11-
export default function (Vue, opts = { lang: 'en', locales: {} }) {
11+
export default function install (Vue, opts = { lang: 'en', locales: {} }) {
1212
defineConfig(Vue.config, opts.lang)
1313
extend(Vue, opts.locales)
1414
}
@@ -30,3 +30,12 @@ function defineConfig (config, lang) {
3030
set: (val) => { lang = val }
3131
})
3232
}
33+
34+
35+
/**
36+
* install automaticlly
37+
*/
38+
39+
if (typeof window !== 'undefined' && window.Vue) {
40+
window.Vue.use(install)
41+
}

0 commit comments

Comments
 (0)