+
+ Dialog 对话框
+
+
+ 用于显示重要提示或请求用户进行重要操作,一种打断当前操作的模态视图。
+
+
+
+
@@ -2625,3 +2936,589 @@ exports[`Dialog > Dialog mobileVue demo works fine 1`] = `
`;
+
+exports[`Dialog > Dialog multiStateVue demo works fine 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[`Dialog > Dialog pluginVue demo works fine 1`] = `
+
+`;
diff --git a/src/dialog/__test__/demo.test.jsx b/src/dialog/__test__/demo.test.jsx
index 2425d3342..1c9c74eae 100644
--- a/src/dialog/__test__/demo.test.jsx
+++ b/src/dialog/__test__/demo.test.jsx
@@ -5,14 +5,20 @@
import { mount } from '@vue/test-utils';
import confirmVue from '@/dialog/demos/confirm.vue';
import feedbackVue from '@/dialog/demos/feedback.vue';
+import imageDialogVue from '@/dialog/demos/image-dialog.vue';
import inputVue from '@/dialog/demos/input.vue';
import mobileVue from '@/dialog/demos/mobile.vue';
+import multiStateVue from '@/dialog/demos/multi-state.vue';
+import pluginVue from '@/dialog/demos/plugin.vue';
const mapper = {
confirmVue,
feedbackVue,
+ imageDialogVue,
inputVue,
mobileVue,
+ multiStateVue,
+ pluginVue,
};
describe('Dialog', () => {
diff --git a/src/list/__test__/__snapshots__/demo.test.jsx.snap b/src/list/__test__/__snapshots__/demo.test.jsx.snap
index a297738c1..c3f6ab99a 100644
--- a/src/list/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/list/__test__/__snapshots__/demo.test.jsx.snap
@@ -137,18 +137,20 @@ exports[`List > List pullRefreshVue demo works fine 1`] = `
class="t-pull-down-refresh"
>
diff --git a/src/pull-down-refresh/__test__/__snapshots__/demo.test.jsx.snap b/src/pull-down-refresh/__test__/__snapshots__/demo.test.jsx.snap
index df68706e3..2e58f63d8 100644
--- a/src/pull-down-refresh/__test__/__snapshots__/demo.test.jsx.snap
+++ b/src/pull-down-refresh/__test__/__snapshots__/demo.test.jsx.snap
@@ -3,134 +3,210 @@
exports[`PullDownRefresh > PullDownRefresh baseVue demo works fine 1`] = `
-`;
-
-exports[`PullDownRefresh > PullDownRefresh loadingTextsVue demo works fine 1`] = `
-
-
-
-
-
-
+ class="t-pull-down-refresh__text"
+ />
-
-
-
-`;
-
-exports[`PullDownRefresh > PullDownRefresh mobileVue demo works fine 1`] = `
-
-
-
+
+
-
+
-
-
PullDownRefresh 下拉刷新
用于快速刷新页面信息,刷新可以是整页刷新也可以是页面的局部刷新。
拖拽该区域演示 顶部下拉刷新
+
+
+
+
PullDownRefresh mobileVue demo works fine 1`] = `
PullDownRefresh mobileVue demo works fine 1`] = `
+
+
+
+
+
+
+`;
+
+exports[`PullDownRefresh > PullDownRefresh loadingTextsVue demo works fine 1`] = `
+
+`;
+
+exports[`PullDownRefresh > PullDownRefresh mobileVue demo works fine 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+ PullDownRefresh 下拉刷新
+
+
+ 用于快速刷新页面信息,刷新可以是整页刷新也可以是页面的局部刷新。
+
+
+ 拖拽该区域演示 顶部下拉刷新
+
+
+
+
@@ -228,18 +635,20 @@ exports[`PullDownRefresh > PullDownRefresh timeoutVue demo works fine 1`] = `
class="t-pull-down-refresh"
>
diff --git a/src/pull-down-refresh/__test__/__snapshots__/index.test.jsx.snap b/src/pull-down-refresh/__test__/__snapshots__/index.test.jsx.snap
index dba2a2c9d..8fff20cba 100644
--- a/src/pull-down-refresh/__test__/__snapshots__/index.test.jsx.snap
+++ b/src/pull-down-refresh/__test__/__snapshots__/index.test.jsx.snap
@@ -1,22 +1,24 @@
// Vitest Snapshot v1
-exports[`PullDownRefresh > : props > : others 1`] = `
+exports[`PullDownRefresh > :props > :others 1`] = `
diff --git a/src/pull-down-refresh/__test__/index.test.jsx b/src/pull-down-refresh/__test__/index.test.jsx
index 5fa3eed9e..57dd58f4b 100644
--- a/src/pull-down-refresh/__test__/index.test.jsx
+++ b/src/pull-down-refresh/__test__/index.test.jsx
@@ -9,8 +9,8 @@ describe('PullDownRefresh', () => {
global.ResizeObserver = MockResizeObserver;
});
- describe(': props', () => {
- it(': loadingBarHeight', async () => {
+ describe(':props', () => {
+ it(':loadingBarHeight', async () => {
const wrapper = mount(
);
const loadingBar = wrapper.find('.t-pull-down-refresh__loading');
expect(window.getComputedStyle(loadingBar.element).height).toBe(`${30}px`);
@@ -19,18 +19,14 @@ describe('PullDownRefresh', () => {
expect(window.getComputedStyle(loadingBar.element).height).toBe(`${90}px`);
});
- it(': others', async () => {
+ it(':others', async () => {
const status = ref(false);
- const loadingProps = {
- theme: 'circular',
- };
- const loadingTexts = ['a', 'b', 'c', 'd'];
+ const loadingTexts = ['pulling', 'loosing', 'loading', 'success'];
const maxBarHeight = ref(80);
const onChange = vi.fn((value) => {
status.value = value;
});
const onRefresh = vi.fn(() => {
- status.value = true;
setTimeout(() => {
status.value = false;
}, 2000);
@@ -39,7 +35,6 @@ describe('PullDownRefresh', () => {
const wrapper = mount(
{
/>,
);
const track = wrapper.find('.t-pull-down-refresh__track');
- const maxBar = wrapper.find('.t-pull-down-refresh__max');
+ const maxBar = wrapper.find('.t-pull-down-refresh__tips');
await nextTick();
maxBar.trigger('resize', {
@@ -55,24 +50,20 @@ describe('PullDownRefresh', () => {
});
trigger(track, 'touchstart', 50, 0);
- await wrapper.setProps({ value: true, maxBarHeight: '80px' });
+ await wrapper.setProps({ maxBarHeight: '80px' });
trigger(track, 'touchmove', 50, 20);
trigger(track, 'touchmove', 50, 70);
trigger(track, 'touchmove', 50, 120);
trigger(track, 'touchmove', 50, 170);
- expect(wrapper.vm.loadingText).toBe('b'); // loosing
+ expect(wrapper.vm.loadingText).toBe('loosing');
expect(window.getComputedStyle(maxBar.element).height).toBe(`${80}px`);
trigger(track, 'touchend', 50, 170);
expect(wrapper.element).toMatchSnapshot();
-
- await new Promise((resolve, reject) => {
- setTimeout(() => resolve(), 350); // 大于 300ms
- });
});
});
- describe(': events', () => {
- it('functions and refreshTimeout', async () => {
+ describe(':events', () => {
+ it('timeout', async () => {
const status = ref(false);
const refreshTimeout = 500;
@@ -80,15 +71,14 @@ describe('PullDownRefresh', () => {
status.value = value;
});
const onRefresh = vi.fn(() => {
- status.value = true;
setTimeout(() => {
status.value = false;
- }, 1000); // 大于设定值
+ }, 800); // 大于设定值
});
const onTimeout = vi.fn();
const wrapper = mount(
- {
);
const target = wrapper.find('.t-pull-down-refresh__track');
- const maxBar = wrapper.find('.t-pull-down-refresh__max');
+ const maxBar = wrapper.find('.t-pull-down-refresh__tips');
await nextTick();
maxBar.trigger('resize', {
@@ -106,7 +96,6 @@ describe('PullDownRefresh', () => {
});
trigger(target, 'touchstart', 50, 0);
- await wrapper.setProps({ value: true });
trigger(target, 'touchmove', 50, 20);
trigger(target, 'touchmove', 50, 70);
trigger(target, 'touchmove', 50, 120);
@@ -117,8 +106,8 @@ describe('PullDownRefresh', () => {
setTimeout(() => resolve(), 1000); // 超时 1000ms
});
- expect(wrapper.emitted()).toHaveProperty('update:value'); // useModel 受控模式
-
+ // expect(wrapper.emitted()).toHaveProperty('update:value'); // useModel 受控模式
+
expect(onChange).toHaveBeenCalled();
expect(onRefresh).toHaveBeenCalled();
expect(onTimeout).toHaveBeenCalled();
diff --git a/src/pull-down-refresh/demos/base.vue b/src/pull-down-refresh/demos/base.vue
index 8d3fdcdbf..a2e59a073 100644
--- a/src/pull-down-refresh/demos/base.vue
+++ b/src/pull-down-refresh/demos/base.vue
@@ -1,16 +1,40 @@
- 下拉刷新
+
+
+
+ PullDownRefresh 下拉刷新
+ 用于快速刷新页面信息,刷新可以是整页刷新也可以是页面的局部刷新。
+ 拖拽该区域演示 顶部下拉刷新
+
+
+
+
+
-
+
diff --git a/src/pull-down-refresh/demos/mobile.vue b/src/pull-down-refresh/demos/mobile.vue
index e4075a73e..fd7c731c3 100644
--- a/src/pull-down-refresh/demos/mobile.vue
+++ b/src/pull-down-refresh/demos/mobile.vue
@@ -1,54 +1,19 @@
-
-
-
- PullDownRefresh 下拉刷新
- 用于快速刷新页面信息,刷新可以是整页刷新也可以是页面的局部刷新。
- 拖拽该区域演示 顶部下拉刷新
-
-
-
-
-
+
+
-
diff --git a/src/pull-down-refresh/props.ts b/src/pull-down-refresh/props.ts
index 863a34cb0..431b7a4f9 100644
--- a/src/pull-down-refresh/props.ts
+++ b/src/pull-down-refresh/props.ts
@@ -47,6 +47,8 @@ export default {
onChange: Function as PropType
,
/** 结束下拉时触发 */
onRefresh: Function as PropType,
+ /** 滚动到页面底部时触发 */
+ onScrolltolower: Function as PropType,
/** 刷新超时触发 */
onTimeout: Function as PropType,
};
diff --git a/src/pull-down-refresh/pull-down-refresh.en-US.md b/src/pull-down-refresh/pull-down-refresh.en-US.md
new file mode 100644
index 000000000..4cb9dc7fc
--- /dev/null
+++ b/src/pull-down-refresh/pull-down-refresh.en-US.md
@@ -0,0 +1,28 @@
+:: BASE_DOC ::
+
+## API
+
+### PullDownRefresh Props
+
+name | type | default | description | required
+-- | -- | -- | -- | --
+loadingBarHeight | String / Number | 50 | \- | N
+loadingProps | Object | - | Typescript:`LoadingProps`,[Loading API Documents](./loading?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/pull-down-refresh/type.ts) | N
+loadingTexts | Array | [] | Typescript:`string[]` | N
+maxBarHeight | String / Number | 80 | \- | N
+refreshTimeout | Number | 3000 | \- | N
+value | Boolean | false | `v-model` and `v-model:value` is supported | N
+defaultValue | Boolean | false | uncontrolled property | N
+onChange | Function | | Typescript:`(value: boolean) => void`
| N
+onRefresh | Function | | Typescript:`() => void`
| N
+onScrolltolower | Function | | Typescript:`() => void`
| N
+onTimeout | Function | | Typescript:`() => void`
| N
+
+### PullDownRefresh Events
+
+name | params | description
+-- | -- | --
+change | `(value: boolean)` | \-
+refresh | \- | \-
+scrolltolower | \- | \-
+timeout | \- | \-
diff --git a/src/pull-down-refresh/pull-down-refresh.md b/src/pull-down-refresh/pull-down-refresh.md
index 7fd43821c..1dfdd651c 100644
--- a/src/pull-down-refresh/pull-down-refresh.md
+++ b/src/pull-down-refresh/pull-down-refresh.md
@@ -14,6 +14,7 @@ value | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值
defaultValue | Boolean | false | 组件状态,值为 `true` 表示下拉状态,值为 `false` 表示收起状态。非受控属性 | N
onChange | Function | | TS 类型:`(value: boolean) => void`
下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态 | N
onRefresh | Function | | TS 类型:`() => void`
结束下拉时触发 | N
+onScrolltolower | Function | | TS 类型:`() => void`
滚动到页面底部时触发 | N
onTimeout | Function | | TS 类型:`() => void`
刷新超时触发 | N
### PullDownRefresh Events
@@ -21,5 +22,6 @@ onTimeout | Function | | TS 类型:`() => void`
刷新超时触发 | N
名称 | 参数 | 描述
-- | -- | --
change | `(value: boolean)` | 下拉或收起时触发,用户手势往下滑动触发下拉状态,手势松开触发收起状态
-refresh | - | 结束下拉时触发
-timeout | - | 刷新超时触发
+refresh | \- | 结束下拉时触发
+scrolltolower | \- | 滚动到页面底部时触发
+timeout | \- | 刷新超时触发
diff --git a/src/pull-down-refresh/pull-down-refresh.vue b/src/pull-down-refresh/pull-down-refresh.vue
index 277bcec64..521ec5724 100644
--- a/src/pull-down-refresh/pull-down-refresh.vue
+++ b/src/pull-down-refresh/pull-down-refresh.vue
@@ -1,19 +1,18 @@
-
+
-
-
-
-
{{ loadingText }}
+
+
{{ loadingText }}
@@ -22,103 +21,101 @@