mirror of
https://gitee.com/vant-contrib/vant.git
synced 2026-07-08 07:31:06 +08:00
Compare commits
No commits in common. "651305e8ce2014e44b791d2a0af5c865f76cd037" and "03c2f241b8f8051d1bdf9a2b4eae4511140b4f99" have entirely different histories.
651305e8ce
...
03c2f241b8
@ -41,7 +41,7 @@ export function useTouch() {
|
||||
const move = ((event: TouchEvent) => {
|
||||
const touch = event.touches[0];
|
||||
// safari back will set clientX to negative number
|
||||
deltaX.value = (touch.clientX < 0 ? 0 : touch.clientX) - startX.value;
|
||||
deltaX.value = touch.clientX < 0 ? 0 : touch.clientX - startX.value;
|
||||
deltaY.value = touch.clientY - startY.value;
|
||||
offsetX.value = Math.abs(deltaX.value);
|
||||
offsetY.value = Math.abs(deltaY.value);
|
||||
|
||||
@ -65,16 +65,6 @@ const numberKeyboardProps = {
|
||||
|
||||
export type NumberKeyboardProps = ExtractPropTypes<typeof numberKeyboardProps>;
|
||||
|
||||
function shuffle(array: unknown[]) {
|
||||
for (let i = array.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
const temp = array[i];
|
||||
array[i] = array[j];
|
||||
array[j] = temp;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name,
|
||||
|
||||
@ -99,7 +89,7 @@ export default defineComponent({
|
||||
.map((_, i) => ({ text: i + 1 }));
|
||||
|
||||
if (props.randomKeyOrder) {
|
||||
shuffle(keys);
|
||||
keys.sort(() => (Math.random() > 0.5 ? 1 : -1));
|
||||
}
|
||||
|
||||
return keys;
|
||||
|
||||
@ -365,7 +365,6 @@ export default defineComponent({
|
||||
const renderNav = () =>
|
||||
children.map((item, index) => (
|
||||
<TabsTitle
|
||||
key={item.id}
|
||||
v-slots={{ title: item.$slots.title }}
|
||||
id={`${id}-${index}`}
|
||||
ref={setTitleRefs(index)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user