chore(List): use tsx

This commit is contained in:
chenjiahan 2020-10-09 20:45:26 +08:00
parent 6cecf4852f
commit a1b08babfc
3 changed files with 15 additions and 15 deletions

View File

@ -58,7 +58,7 @@
"dependencies": {
"@babel/runtime": "7.x",
"@vant/icons": "1.3.1",
"@vant/use": "^0.0.8",
"@vant/use": "^0.0.9",
"vue-lazyload": "1.2.3"
},
"peerDependencies": {

View File

@ -1,4 +1,4 @@
import { ref, watch, nextTick, onUpdated, onMounted } from 'vue';
import { ref, watch, nextTick, onUpdated, onMounted, PropType } from 'vue';
// Utils
import { isHidden, createNamespace } from '../utils';
@ -20,18 +20,18 @@ export default createComponent({
errorText: String,
loadingText: String,
finishedText: String,
immediateCheck: {
type: Boolean,
default: true,
},
offset: {
type: [Number, String],
default: 300,
},
direction: {
type: String,
type: String as PropType<'up' | 'down'>,
default: 'down',
},
immediateCheck: {
type: Boolean,
default: true,
},
},
emits: ['load', 'update:error', 'update:loading'],
@ -39,8 +39,8 @@ export default createComponent({
setup(props, { emit, slots }) {
// use sync innerLoading state to avoid repeated loading in some edge cases
const loading = ref(false);
const root = ref();
const placeholder = ref();
const root = ref<HTMLElement>();
const placeholder = ref<HTMLElement>();
const scrollParent = useScrollParent(root);
const check = () => {
@ -108,7 +108,7 @@ export default createComponent({
{slots.loading ? (
slots.loading()
) : (
<Loading size="16">{props.loadingText || t('loading')}</Loading>
<Loading size={16}>{props.loadingText || t('loading')}</Loading>
)}
</div>
);
@ -118,7 +118,7 @@ export default createComponent({
watch([() => props.loading, () => props.finished], check);
onUpdated(() => {
loading.value = props.loading;
loading.value = props.loading!;
});
onMounted(() => {

View File

@ -2212,10 +2212,10 @@
resolved "https://registry.yarnpkg.com/@vant/touch-emulator/-/touch-emulator-1.2.0.tgz#486300b23e57db9ce9231a04e0a0c621c68692d8"
integrity sha512-sJ97zU85zOq51qoi7+CpBEcOyH3CitjP1KC7/GQwqaurUJni+EP7/F9n0HMnAh8GXMjgtgDBNJ5z48x+coNKYQ==
"@vant/use@^0.0.8":
version "0.0.8"
resolved "https://registry.npmjs.org/@vant/use/-/use-0.0.8.tgz#46b0e957c8e4250a7e94951f20cfa6fdbd550a41"
integrity sha512-NO8yBGhE1jF2xnhgSeEDZUFlKXHtPzVNhxLnzH74P1Kdh3XrrQO6p+1ZL8HF52YMT2F1OY6FpaBC/WZmK3Xmog==
"@vant/use@^0.0.9":
version "0.0.9"
resolved "https://registry.npmjs.org/@vant/use/-/use-0.0.9.tgz#938b41e8dd682f063450f45699111ab30dd279c1"
integrity sha512-P+/q3MqFCmoNStQU8qpPxDNtBLy9Q82xx05APm7ZqEhoJLPynK1u0giC1JeEvFoSTEJ3y4XxN+R7YqmpXnf/7Q==
"@vue/babel-helper-vue-transform-on@^1.0.0-rc.2":
version "1.0.0-rc.2"