-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from johndatserakis/upgrade-to-vue-3
Upgrade to Vue 3
- Loading branch information
Showing
23 changed files
with
8,423 additions
and
14,542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
{ | ||
"presets": [ | ||
["env", { "modules": false }], | ||
"stage-3" | ||
], | ||
"env": { | ||
"test": { | ||
"presets": [ | ||
["env", { "targets": { "node": "current" }}] | ||
] | ||
} | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"modules": false | ||
} | ||
] | ||
], | ||
"env": { | ||
"test": { | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
] | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"printWidth": 100, | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "all", | ||
"useTabs": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,52 @@ | ||
import Vue from 'vue'; | ||
|
||
var reactiveComponent = new Vue({ | ||
data: function data() { | ||
return { | ||
event: null, | ||
vssWidth: null, | ||
vssHeight: null | ||
} | ||
} | ||
}); | ||
|
||
var VueScreenSizeMixin = { | ||
computed: { | ||
$vssEvent: function $vssEvent() { | ||
return reactiveComponent.event | ||
}, | ||
$vssWidth: function $vssWidth() { | ||
return reactiveComponent.vssWidth || this.getScreenWidth() | ||
}, | ||
$vssHeight: function $vssHeight() { | ||
return reactiveComponent.vssHeight || this.getScreenHeight() | ||
} | ||
data: function data() { | ||
return { | ||
event: null, | ||
vssWidth: null, | ||
vssHeight: null, | ||
}; | ||
}, | ||
computed: { | ||
$vssEvent: function $vssEvent() { | ||
return this.event; | ||
}, | ||
methods: { | ||
getScreenWidth: function getScreenWidth() { | ||
return window.innerWidth | ||
|| document.documentElement.clientWidth | ||
|| document.body.clientWidth | ||
}, | ||
getScreenHeight: function getScreenHeight() { | ||
return window.innerHeight | ||
|| document.documentElement.clientHeight | ||
|| document.body.clientHeight | ||
}, | ||
handleResize: function handleResize(event) { | ||
reactiveComponent.event = event; | ||
reactiveComponent.vssWidth = this.getScreenWidth(); | ||
reactiveComponent.vssHeight = this.getScreenHeight(); | ||
}, | ||
|
||
$vssDestroyListener: function $vssDestroyListener() { | ||
window.removeEventListener('resize', this.handleResize); | ||
} | ||
$vssWidth: function $vssWidth() { | ||
return this.vssWidth || this.getScreenWidth(); | ||
}, | ||
$vssHeight: function $vssHeight() { | ||
return this.vssHeight || this.getScreenHeight(); | ||
}, | ||
mounted: function mounted() { | ||
window.addEventListener('resize', this.handleResize); | ||
}, | ||
methods: { | ||
getScreenWidth: function getScreenWidth() { | ||
return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; | ||
}, | ||
getScreenHeight: function getScreenHeight() { | ||
return ( | ||
window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight | ||
); | ||
}, | ||
handleResize: function handleResize(event) { | ||
this.event = event; | ||
this.vssWidth = this.getScreenWidth(); | ||
this.vssHeight = this.getScreenHeight(); | ||
}, | ||
destroyed: function destroyed() { | ||
window.removeEventListener('resize', this.handleResize); | ||
} | ||
} | ||
|
||
var install = function (Vue$$1) { | ||
Vue$$1.mixin(VueScreenSizeMixin); | ||
$vssDestroyListener: function $vssDestroyListener() { | ||
window.removeEventListener('resize', this.handleResize); | ||
}, | ||
}, | ||
mounted: function mounted() { | ||
window.addEventListener('resize', this.handleResize); | ||
}, | ||
destroyed: function destroyed() { | ||
window.removeEventListener('resize', this.handleResize); | ||
}, | ||
}; | ||
|
||
// Note that here we're not only exporting the install function, but | ||
// also the mixin itself - this is so with can `Vue.use()` or | ||
// `mixins: [],` it. | ||
var index = { install: install, VueScreenSizeMixin: VueScreenSizeMixin } | ||
var install = function (app) { | ||
app.mixin(VueScreenSizeMixin); | ||
}; | ||
|
||
export default index; | ||
export default install; | ||
export { VueScreenSizeMixin }; |
Oops, something went wrong.