76 lines
1.5 KiB
Markdown
76 lines
1.5 KiB
Markdown
# 友达赏
|
|
|
|
## 代码
|
|
```sh
|
|
# 导入基础
|
|
import { defineComponent, ref } from 'vue';
|
|
# 导入页面加载方法
|
|
import { onLoad } from '@dcloudio/uni-app';
|
|
let icon = ref("/static/app-plus/icon_108.png");
|
|
# 使用页面加载方法
|
|
onLoad(() => {
|
|
console.log('页面加载中');
|
|
});
|
|
```
|
|
# 新文件
|
|
```vue
|
|
<!-- 详情 -->
|
|
<template>
|
|
<page-no-container ref="pageContainer" title="协议" show-back>
|
|
|
|
</page-no-container>
|
|
</template>
|
|
|
|
<script setup>
|
|
let pageContainer = ref(null);
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped></style>
|
|
```
|
|
|
|
# 新文件2
|
|
```vue
|
|
<template>
|
|
<page-container ref="pageContainer" title="优惠卷" show-back :show-not-data="showNotData" :refresh="onRefresh">
|
|
|
|
</page-container>
|
|
</template>
|
|
|
|
<script setup>
|
|
//# 必须要引入
|
|
import PageContainer from '@/components/youdas-container/page-container.vue'
|
|
let pageContainer = ref(null);
|
|
let showNotData = ref(false);
|
|
// 刷新方法
|
|
const onRefresh = async (paging) => {
|
|
await yds.sleep(500);
|
|
paging.complete();
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped></style>
|
|
```
|
|
|
|
|
|
# 新文件3 下拉刷新
|
|
```vue
|
|
<template>
|
|
<PageContainer ref="pageContainer" title="我的地址管理" show-back :show-not-data="showNotData" :refresh="onRefresh">
|
|
|
|
</PageContainer>
|
|
</template>
|
|
|
|
<script setup>
|
|
|
|
let pageContainer = ref(null);
|
|
let showNotData = ref(false);
|
|
// 刷新方法
|
|
const onRefresh = async (paging) => {
|
|
await yds.sleep(500);
|
|
paging.complete();
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped></style>
|
|
``` |