Skip to content

Commit

Permalink
feat: Can pass global config via Vue.use
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyi7099 committed Jul 31, 2018
1 parent 01495dd commit 2cd8b12
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
6 changes: 4 additions & 2 deletions dist/vuescroll-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,8 @@ function _init() {
components = _opts$components === undefined ? {} : _opts$components,
_opts$config = opts.config,
config = _opts$config === undefined ? {} : _opts$config,
_opts$ops = opts.ops,
ops = _opts$ops === undefined ? {} : _opts$ops,
validator = opts.validator;

// Init component
Expand All @@ -1846,12 +1848,12 @@ function _init() {

// Init render
var vsCtor = withBase(render, Vue$$1, components, opts);

// Init Mix
initMix(vsCtor, opts.mixins);

// Init Config
extendOpts(config, validator);
// Inject global config
Vue$$1.prototype.$vuescrollConfig = ops;
}

function initMix(ctor, mix) {
Expand Down
2 changes: 1 addition & 1 deletion dist/vuescroll-native.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions dist/vuescroll-slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -3627,6 +3627,8 @@ function _init() {
components = _opts$components === undefined ? {} : _opts$components,
_opts$config = opts.config,
config = _opts$config === undefined ? {} : _opts$config,
_opts$ops = opts.ops,
ops = _opts$ops === undefined ? {} : _opts$ops,
validator = opts.validator;

// Init component
Expand All @@ -3638,12 +3640,12 @@ function _init() {

// Init render
var vsCtor = withBase(render, Vue$$1, components, opts);

// Init Mix
initMix(vsCtor, opts.mixins);

// Init Config
extendOpts(config, validator);
// Inject global config
Vue$$1.prototype.$vuescrollConfig = ops;
}

function initMix(ctor, mix) {
Expand Down
2 changes: 1 addition & 1 deletion dist/vuescroll-slide.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions dist/vuescroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,8 @@ function _init() {
components = _opts$components === undefined ? {} : _opts$components,
_opts$config = opts.config,
config = _opts$config === undefined ? {} : _opts$config,
_opts$ops = opts.ops,
ops = _opts$ops === undefined ? {} : _opts$ops,
validator = opts.validator;

// Init component
Expand All @@ -1916,12 +1918,12 @@ function _init() {

// Init render
var vsCtor = withBase(render, Vue$$1, components, opts);

// Init Mix
initMix(vsCtor, opts.mixins);

// Init Config
extendOpts(config, validator);
// Inject global config
Vue$$1.prototype.$vuescrollConfig = ops;
}

function initMix(ctor, mix) {
Expand Down
2 changes: 1 addition & 1 deletion dist/vuescroll.min.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/mode/shared/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export function _init(opts = {}) {
Vue,
components = {},
config = {},
ops = {},
validator
} = opts;

Expand All @@ -89,12 +90,12 @@ export function _init(opts = {}) {

// Init render
let vsCtor = withBase(render, Vue, components, opts);

// Init Mix
initMix(vsCtor, opts.mixins);

// Init Config
extendOpts(config, validator);
// Inject global config
Vue.prototype.$vuescrollConfig = ops;
}

function initMix(ctor, mix) {
Expand Down

0 comments on commit 2cd8b12

Please sign in to comment.