Skip to content

Commit

Permalink
chore(Loading): add loadingPlugin to plugins file
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Jun 11, 2024
1 parent 21cf12d commit 862a98b
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 183 deletions.
190 changes: 13 additions & 177 deletions src/loading/__test__/__snapshots__/demo.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -927,183 +927,19 @@ exports[`Loading > Loading mobileVue demo works fine 1`] = `
</div>
</div>
<div
class="tdesign-mobile-demo-block"
data-v-448d2bed=""
>
<div
class="tdesign-mobile-demo-block__header"
>
<h2
class="tdesign-mobile-demo-block__title"
>
04 全屏加载
</h2>
<p
class="tdesign-mobile-demo-block__summary"
>
全屏展示加载状态,阻止用户操作。
</p>
</div>
<div
class="tdesign-mobile-demo-block__slot"
>
<div
class="loading-demo"
data-v-448d2bed=""
data-v-d41a5df4=""
>
<!---->
<div
data-v-d41a5df4=""
>
全局加载开关(开启加载1秒后自动归位):
<div
class="t-switch t-switch--small"
data-v-d41a5df4=""
>
<div
class="t-switch__dot t-switch__dot--small t-switch__dot--plain"
>
<div
class="t-switch__label t-switch__label--small"
>
<!---->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="tdesign-mobile-demo-block"
data-v-448d2bed=""
>
<div
class="tdesign-mobile-demo-block__header"
>
<h2
class="tdesign-mobile-demo-block__title"
>
05 挂载到指定元素
</h2>
<p
class="tdesign-mobile-demo-block__summary"
>
可通过 attach 挂载到指定元素。注:被挂载元素(loading的父元素)需设置:position: relative;
</p>
</div>
<div
class="tdesign-mobile-demo-block__slot"
>
<div
class="loading-demo"
data-v-448d2bed=""
data-v-4de40010=""
>
<div
class="loading-attach-demo__title"
data-v-4de40010=""
id="alice"
>
Hello, I'm Alice. I'm going to be a front-end developer.
</div>
<!---->
<div
class="t-switch t-switch--small"
data-v-4de40010=""
>
<div
class="t-switch__dot t-switch__dot--small"
>
<div
class="t-switch__label t-switch__label--small"
>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="tdesign-mobile-demo-block"
data-v-448d2bed=""
>
<div
class="tdesign-mobile-demo-block__header"
>
<h2
class="tdesign-mobile-demo-block__title"
>
06 函数方式调用
</h2>
<!--v-if-->
</div>
<div
class="tdesign-mobile-demo-block__slot"
>
<div
class="loading-demo"
data-v-2b16437a=""
data-v-448d2bed=""
>
<div
class="loading-service-demo"
data-v-2b16437a=""
id="loading-service-demo"
>
Loading 挂载容器
</div>
<div
class="space"
data-v-2b16437a=""
>
<button
aria-disabled="false"
class="t-button t-button--size-small t-button--base t-button--default t-button--rectangle t-loading__btn"
data-v-2b16437a=""
role="button"
type="button"
>
<!---->
<span
class="t-button__content"
>
函数方式加载(局部)
</span>
<!---->
</button>
<button
aria-disabled="false"
class="t-button t-button--size-small t-button--base t-button--default t-button--rectangle"
data-v-2b16437a=""
role="button"
type="button"
>
<!---->
<span
class="t-button__content"
>
函数方式加载(全屏)
</span>
<!---->
</button>
</div>
</div>
</div>
</div>
<!-- 视觉稿待定,暂时注释 -->
<!-- &lt;tdesign-demo-block title="04 全屏加载" summary="全屏展示加载状态,阻止用户操作。"&gt;
&lt;fullscreen /&gt;
&lt;/tdesign-demo-block&gt;
&lt;tdesign-demo-block
title="05 挂载到指定元素"
summary="可通过 attach 挂载到指定元素。注:被挂载元素(loading的父元素)需设置:position: relative;"
&gt;
&lt;attach /&gt;
&lt;/tdesign-demo-block&gt;
&lt;tdesign-demo-block title="06 函数方式调用"&gt;
&lt;service /&gt;
&lt;/tdesign-demo-block&gt; -->
</div>
`;

Expand Down
2 changes: 1 addition & 1 deletion src/loading/demos/attach.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</template>
<script setup lang="ts">
import { ref } from 'vue';
import TSwitch from '../../switch';
import { Switch as TSwitch } from 'tdesign-mobile-vue';
const loading = ref(false);
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/loading/demos/fullscreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
import TSwitch from '../../switch';
import { Switch as TSwitch } from 'tdesign-mobile-vue';
const loading = ref(false);
Expand Down
5 changes: 3 additions & 2 deletions src/loading/demos/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<tdesign-demo-block title="03 加载速度" summary="加载速度调整">
<speed />
</tdesign-demo-block>
<tdesign-demo-block title="04 全屏加载" summary="全屏展示加载状态,阻止用户操作。">
<!-- 视觉稿待定,暂时注释 -->
<!-- <tdesign-demo-block title="04 全屏加载" summary="全屏展示加载状态,阻止用户操作。">
<fullscreen />
</tdesign-demo-block>
<tdesign-demo-block
Expand All @@ -39,7 +40,7 @@
</tdesign-demo-block>
<tdesign-demo-block title="06 函数方式调用">
<service />
</tdesign-demo-block>
</tdesign-demo-block> -->
</div>
</template>

Expand Down
3 changes: 1 addition & 2 deletions src/loading/demos/service.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

<script setup lang="ts">
import { ref } from 'vue';
import { LoadingPlugin } from '../plugin';
import TButton from '../../button';
import { LoadingPlugin, Button as TButton } from 'tdesign-mobile-vue';
const content = ref(null);
const attachLoading = ref(false);
Expand Down
3 changes: 3 additions & 0 deletions src/loading/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import { TdLoadingProps } from './type';
import './style';

export * from './type';
export * from './plugin';
export { default as LoadingPlugin } from './plugin';

export type LoadingProps = TdLoadingProps;

const _Loading: WithInstallType<typeof Loading> = withInstall(Loading);
Expand Down
1 change: 1 addition & 0 deletions src/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export { DialogPlugin } from './dialog';
export { MessagePlugin } from './message';
export { ToastPlugin } from './toast';
export { DrawerPlugin } from './drawer';
export { LoadingPlugin } from './loading';

0 comments on commit 862a98b

Please sign in to comment.