Skip to content

Commit

Permalink
chore: bump to typescript v5 (#2525)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Aug 29, 2023
1 parent 0ca9dfd commit 0fc50c3
Show file tree
Hide file tree
Showing 11 changed files with 43 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"markdown-it-container": "^3.0.0",
"prettier": "^3.0.2",
"rimraf": "^5.0.1",
"typescript": "^4.9.3",
"typescript": "^5.2.2",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.4.9",
"vite-plugin-md": "^0.21.5",
Expand Down
44 changes: 25 additions & 19 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion src/packages/__VUE/datepicker/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ export default create({
min++;
}
if (min <= val) {
if (min <= +val) {
index++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/griditem/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default create({
style.paddingTop = `${100 / +parent.columnNum}%`;
} else if (parent.gutter) {
style.paddingRight = pxCheck(parent.gutter);
if (index.value >= parent.columnNum) {
if (index.value >= +parent.columnNum) {
style.marginTop = pxCheck(parent.gutter);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/griditem/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default create({
style.paddingTop = `${100 / +parent.columnNum}%`;
} else if (parent.gutter) {
style.paddingRight = pxCheck(parent.gutter);
if (index.value >= parent.columnNum) {
if (index.value >= +parent.columnNum) {
style.marginTop = pxCheck(parent.gutter);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/numberkeyboard/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</template>

<script lang="ts">
import { computed, ref, watch, Ref } from 'vue';
import { computed, ref, watch, Ref, PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
import Popup from '../popup/index.taro.vue';
const { create, translate } = createComponent('number-keyboard');
Expand Down Expand Up @@ -105,7 +105,7 @@ export default create({
default: 'default'
},
customKey: {
type: Array,
type: Array as PropType<string[]>,
default: () => []
},
modelValue: {
Expand Down
6 changes: 3 additions & 3 deletions src/packages/__VUE/numberkeyboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</template>

<script lang="ts">
import { computed, ref, watch, Ref } from 'vue';
import { computed, ref, watch, Ref, PropType } from 'vue';
import { createComponent } from '@/packages/utils/create';
import Popup from '../popup/index.vue';
const { create, translate } = createComponent('number-keyboard');
Expand Down Expand Up @@ -100,7 +100,7 @@ export default create({
default: 'default'
},
customKey: {
type: Array,
type: Array as PropType<string[]>,
default: () => []
},
modelValue: {
Expand Down Expand Up @@ -213,7 +213,7 @@ export default create({
clickKeyIndex.value = item.id;
if (item.type == 'number' || item.type == 'custom') {
emit('input', item.id);
if (props.modelValue.length < props.maxlength) {
if (props.modelValue.length < +props.maxlength) {
emit('update:modelValue', props.modelValue + item.id);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/range/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default create({
const list = marksKeys
.map(parseFloat)
.sort((a, b) => a - b)
.filter((point) => point >= min && point <= max);
.filter((point) => point >= +min && point <= +max);
return list;
});
const scope = computed(() => Number(props.max) - Number(props.min));
Expand Down Expand Up @@ -227,7 +227,7 @@ export default create({
} else {
upperBound = modelValue;
}
let isActive = mark <= upperBound && mark >= lowerBound;
let isActive = mark <= +upperBound && mark >= lowerBound;
return {
[`${classPrefix}-text`]: true,
[`${classPrefix}-text-active`]: isActive
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/range/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export default create({
const list = marksKeys
.map(parseFloat)
.sort((a, b) => a - b)
.filter((point) => point >= min && point <= max);
.filter((point) => point >= +min && point <= +max);
return list;
});
const scope = computed(() => Number(props.max) - Number(props.min));
Expand Down Expand Up @@ -224,7 +224,7 @@ export default create({
} else {
upperBound = modelValue;
}
let isActive = mark <= upperBound && mark >= lowerBound;
let isActive = mark <= +upperBound && mark >= lowerBound;
return {
[`${classPrefix}-text`]: true,
[`${classPrefix}-text-active`]: isActive
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/swiper/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default create({
};
const autoplay = () => {
if (props.autoPlay <= 0 || childCount.value <= 1) return;
if (+props.autoPlay <= 0 || childCount.value <= 1) return;
stopAutoPlay();
state.autoplayTimer = setTimeout(() => {
Expand Down Expand Up @@ -436,7 +436,7 @@ export default create({
watch(
() => props.autoPlay,
(val) => {
val > 0 ? autoplay() : stopAutoPlay();
+val > 0 ? autoplay() : stopAutoPlay();
}
);
Expand Down
6 changes: 3 additions & 3 deletions src/packages/__VUE/video/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ export default create({
};
const timeFormat = (t: number) => {
var h = Math.floor(t / 3600) as string | number;
if (h < 10) {
if (+h < 10) {
h = '0' + h;
}
var m = Math.floor((t % 3600) / 60) as string | number;
if (m < 10) {
if (+m < 10) {
m = '0' + m;
}
var s = Math.round((t % 3600) % 60) as string | number;
if (s < 10) {
if (+s < 10) {
s = '0' + s;
}
var str = '';
Expand Down

0 comments on commit 0fc50c3

Please sign in to comment.