-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reconfigure prettier and update deps
- Loading branch information
Showing
8 changed files
with
9,775 additions
and
4,447 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
Large diffs are not rendered by default.
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
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,65 +1,65 @@ | ||
import scrollTo from "./scrollTo"; | ||
import _ from "./utils"; | ||
import scrollTo from './scrollTo' | ||
import _ from './utils' | ||
|
||
let bindings = []; // store binding data | ||
let bindings = [] // store binding data | ||
|
||
function deleteBinding(el) { | ||
for (let i = 0; i < bindings.length; ++i) { | ||
if (bindings[i].el === el) { | ||
bindings.splice(i, 1); | ||
return true; | ||
} | ||
for (let i = 0; i < bindings.length; ++i) { | ||
if (bindings[i].el === el) { | ||
bindings.splice(i, 1) | ||
return true | ||
} | ||
return false; | ||
} | ||
return false | ||
} | ||
|
||
function findBinding(el) { | ||
for (let i = 0; i < bindings.length; ++i) { | ||
if (bindings[i].el === el) { | ||
return bindings[i]; | ||
} | ||
for (let i = 0; i < bindings.length; ++i) { | ||
if (bindings[i].el === el) { | ||
return bindings[i] | ||
} | ||
} | ||
} | ||
|
||
function getBinding(el) { | ||
let binding = findBinding(el); | ||
let binding = findBinding(el) | ||
|
||
if (binding) { | ||
return binding; | ||
} | ||
if (binding) { | ||
return binding | ||
} | ||
|
||
bindings.push( | ||
binding = { | ||
el: el, | ||
binding: {} | ||
} | ||
); | ||
bindings.push( | ||
(binding = { | ||
el: el, | ||
binding: {}, | ||
}) | ||
) | ||
|
||
return binding; | ||
return binding | ||
} | ||
|
||
function handleClick(e) { | ||
e.preventDefault(); | ||
let ctx = getBinding(this).binding; | ||
e.preventDefault() | ||
let ctx = getBinding(this).binding | ||
|
||
if (typeof ctx.value === "string") { | ||
return scrollTo(ctx.value); | ||
} | ||
scrollTo(ctx.value.el || ctx.value.element, ctx.value); | ||
if (typeof ctx.value === 'string') { | ||
return scrollTo(ctx.value) | ||
} | ||
scrollTo(ctx.value.el || ctx.value.element, ctx.value) | ||
} | ||
|
||
export default { | ||
bind(el, binding) { | ||
getBinding(el).binding = binding; | ||
_.on(el, "click", handleClick); | ||
}, | ||
unbind(el) { | ||
deleteBinding(el); | ||
_.off(el, "click", handleClick); | ||
}, | ||
update(el, binding) { | ||
getBinding(el).binding = binding; | ||
}, | ||
scrollTo, | ||
bindings | ||
}; | ||
bind(el, binding) { | ||
getBinding(el).binding = binding | ||
_.on(el, 'click', handleClick) | ||
}, | ||
unbind(el) { | ||
deleteBinding(el) | ||
_.off(el, 'click', handleClick) | ||
}, | ||
update(el, binding) { | ||
getBinding(el).binding = binding | ||
}, | ||
scrollTo, | ||
bindings, | ||
} |
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,7 +1,7 @@ | ||
export default { | ||
ease: [0.25, 0.1, 0.25, 1.0], | ||
linear: [0.00, 0.0, 1.00, 1.0], | ||
"ease-in": [0.42, 0.0, 1.00, 1.0], | ||
"ease-out": [0.00, 0.0, 0.58, 1.0], | ||
"ease-in-out": [0.42, 0.0, 0.58, 1.0] | ||
}; | ||
ease: [0.25, 0.1, 0.25, 1.0], | ||
linear: [0.0, 0.0, 1.0, 1.0], | ||
'ease-in': [0.42, 0.0, 1.0, 1.0], | ||
'ease-out': [0.0, 0.0, 0.58, 1.0], | ||
'ease-in-out': [0.42, 0.0, 0.58, 1.0], | ||
} |
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,17 +1,17 @@ | ||
import VueScrollTo from "./directive"; | ||
import { setDefaults } from "./scrollTo"; | ||
import VueScrollTo from './directive' | ||
import { setDefaults } from './scrollTo' | ||
|
||
const install = function(Vue, options) { | ||
if (options) setDefaults(options); | ||
Vue.directive("scroll-to", VueScrollTo); | ||
Vue.prototype.$scrollTo = VueScrollTo.scrollTo; | ||
}; | ||
if (options) setDefaults(options) | ||
Vue.directive('scroll-to', VueScrollTo) | ||
Vue.prototype.$scrollTo = VueScrollTo.scrollTo | ||
} | ||
|
||
if (typeof window !== "undefined" && window.Vue) { | ||
window.VueScrollTo = VueScrollTo; | ||
window.VueScrollTo.setDefaults = setDefaults; | ||
window.Vue.use(install); | ||
if (typeof window !== 'undefined' && window.Vue) { | ||
window.VueScrollTo = VueScrollTo | ||
window.VueScrollTo.setDefaults = setDefaults | ||
window.Vue.use(install) | ||
} | ||
|
||
VueScrollTo.install = install; | ||
export default VueScrollTo; | ||
VueScrollTo.install = install | ||
export default VueScrollTo |
Oops, something went wrong.