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

View File

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