Skip to content

Commit

Permalink
Release 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreBonaventure committed Apr 20, 2018
1 parent 612be70 commit df990a1
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 16 deletions.
12 changes: 8 additions & 4 deletions dist/vue-mq.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,28 @@ function selectBreakpoints(breakpoints, currentBreakpoint) {
return breakpoints.slice(index);
}

function isArray(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
}

// USAGE
// mq-layout(mq="lg")
// p I’m lg
var component = {
props: {
mq: {
required: true,
type: String
type: [String, Array]
}
},
computed: {
plusModifier: function plusModifier() {
return this.mq.slice(-1) === '+';
return !isArray(this.mq) && this.mq.slice(-1) === '+';
},
activeBreakpoints: function activeBreakpoints() {
var breakpoints = Object.keys(this.$mqAvailableBreakpoints);
var mq = this.plusModifier ? this.mq.slice(0, -1) : this.mq;
return this.plusModifier ? selectBreakpoints(breakpoints, mq) : [this.mq];
var mq = this.plusModifier ? this.mq.slice(0, -1) : isArray(this.mq) ? this.mq : [this.mq];
return this.plusModifier ? selectBreakpoints(breakpoints, mq) : mq;
}
},
render: function render(h, props) {
Expand Down
12 changes: 8 additions & 4 deletions dist/vue-mq.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,28 @@ function selectBreakpoints(breakpoints, currentBreakpoint) {
return breakpoints.slice(index);
}

function isArray(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
}

// USAGE
// mq-layout(mq="lg")
// p I’m lg
var component = {
props: {
mq: {
required: true,
type: String
type: [String, Array]
}
},
computed: {
plusModifier: function plusModifier() {
return this.mq.slice(-1) === '+';
return !isArray(this.mq) && this.mq.slice(-1) === '+';
},
activeBreakpoints: function activeBreakpoints() {
var breakpoints = Object.keys(this.$mqAvailableBreakpoints);
var mq = this.plusModifier ? this.mq.slice(0, -1) : this.mq;
return this.plusModifier ? selectBreakpoints(breakpoints, mq) : [this.mq];
var mq = this.plusModifier ? this.mq.slice(0, -1) : isArray(this.mq) ? this.mq : [this.mq];
return this.plusModifier ? selectBreakpoints(breakpoints, mq) : mq;
}
},
render: function render(h, props) {
Expand Down
12 changes: 8 additions & 4 deletions dist/vue-mq.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,24 +126,28 @@ function selectBreakpoints(breakpoints, currentBreakpoint) {
return breakpoints.slice(index);
}

function isArray(arg) {
return Object.prototype.toString.call(arg) === '[object Array]';
}

// USAGE
// mq-layout(mq="lg")
// p I’m lg
var component = {
props: {
mq: {
required: true,
type: String
type: [String, Array]
}
},
computed: {
plusModifier: function plusModifier() {
return this.mq.slice(-1) === '+';
return !isArray(this.mq) && this.mq.slice(-1) === '+';
},
activeBreakpoints: function activeBreakpoints() {
var breakpoints = Object.keys(this.$mqAvailableBreakpoints);
var mq = this.plusModifier ? this.mq.slice(0, -1) : this.mq;
return this.plusModifier ? selectBreakpoints(breakpoints, mq) : [this.mq];
var mq = this.plusModifier ? this.mq.slice(0, -1) : isArray(this.mq) ? this.mq : [this.mq];
return this.plusModifier ? selectBreakpoints(breakpoints, mq) : mq;
}
},
render: function render(h, props) {
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-mq.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vue-mq.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-mq",
"version": "0.1.3",
"version": "0.2.0",
"description": "Handle media queries easily & build responsive design with Vue",
"main": "dist/vue-mq.js",
"module": "dist/vue-mq.es.js",
Expand All @@ -11,7 +11,7 @@
"prepublishOnly": "yarn deploy:gh-pages",
"deploy:gh-pages": "yarn build:example && yarn gh-pages -d examples/dist",
"build": "npx rimraf dist && bili",
"release": "yarn test && yarn build && npx release-it"
"release": "yarn test && yarn build && npx release-it --no-requireCleanWorkingDir"
},
"bili": {
"moduleName": "vueMq",
Expand Down

0 comments on commit df990a1

Please sign in to comment.