Skip to content

Commit

Permalink
feat(index): support automatically install for standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Nov 26, 2015
1 parent 6fd543e commit ada2673
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import extend from './extend'


/**
* plugin
* install
*
* @param {Object} Vue
* @param {Object} opts
*/

export default function (Vue, opts = { lang: 'en', locales: {} }) {
export default function install (Vue, opts = { lang: 'en', locales: {} }) {
defineConfig(Vue.config, opts.lang)
extend(Vue, opts.locales)
}
Expand All @@ -30,3 +30,12 @@ function defineConfig (config, lang) {
set: (val) => { lang = val }
})
}


/**
* install automaticlly
*/

if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(install)
}

0 comments on commit ada2673

Please sign in to comment.