fix: 文件格式化错乱,从base搬运过来
This commit is contained in:
parent
0843e69422
commit
3e51d7f81e
@ -57,8 +57,7 @@
|
|||||||
"path": "pages/about/about",
|
"path": "pages/about/about",
|
||||||
"type": "page",
|
"type": "page",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "关于",
|
"navigationBarTitleText": "关于"
|
||||||
"navigationStyle": "custom"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,36 @@
|
|||||||
import RequestComp from './components/request.vue' import UploadComp from './components/upload.vue'
|
<route lang="json5">
|
||||||
import i18n, { t } from '@/locale/index' onShow(() => { console.log('About Show', t('app.name'))
|
{
|
||||||
console.log(uni.getLocale()) console.log(i18n.global.locale) // #ifdef MP-WEIXIN // fix
|
style: {
|
||||||
微信小程序需要手动调用 api 设置一次国际化标题。 uni.setNavigationBarTitle({ title: t('app.name') })
|
navigationBarTitleText: '关于',
|
||||||
// #endif }) // 获取屏幕边界到安全区域距离 const { safeAreaInsets } = uni.getSystemInfoSync() const
|
},
|
||||||
gotoPage = (path) => { uni.navigateTo({ url: `/pages/about/${path}`, }) } const toSubPage = () => {
|
}
|
||||||
uni.navigateTo({ url: '/pages-sub/demo/index', }) }
|
</route>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view
|
||||||
|
class="bg-white overflow-hidden pt-2 px-4"
|
||||||
|
:style="{ marginTop: safeAreaInsets?.top + 'px' }"
|
||||||
|
>
|
||||||
|
<view class="text-center text-3xl mt-8">
|
||||||
|
鸽友们好,我是
|
||||||
|
<text class="text-red-500">菲鸽</text>
|
||||||
|
</view>
|
||||||
|
<RequestComp />
|
||||||
|
<UploadComp />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import RequestComp from './components/request.vue'
|
||||||
|
import UploadComp from './components/upload.vue'
|
||||||
|
|
||||||
|
// 获取屏幕边界到安全区域距离
|
||||||
|
const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.test-css {
|
||||||
|
// mt-4=>1rem=>16px;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,8 +1,67 @@
|
|||||||
import useRequest from '@/hooks/useRequest' import { getFooAPI, postFooAPI, IFooItem } from
|
<route lang="json5">
|
||||||
'@/service/index/foo' import { ref } from 'vue' // import { findPetsByStatusQueryOptions } from
|
{
|
||||||
'@/service/app' // import { useQuery } from '@tanstack/vue-query' const recommendUrl =
|
layout: 'demo',
|
||||||
ref('http://laf.run/signup?code=ohaOgIX') // const initialData = { // name: 'initialData', // id:
|
style: {
|
||||||
'1234', // } const initialData = undefined //
|
navigationBarTitleText: '请求',
|
||||||
适合少部分全局性的接口————多个页面都需要的请求接口,额外编写一个 Service 层 const { loading, error,
|
},
|
||||||
data, run } = useRequest
|
}
|
||||||
<IFooItem></IFooItem>
|
</route>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<view class="p-6 text-center">
|
||||||
|
<view class="my-2">使用的是 laf 云后台</view>
|
||||||
|
<view class="text-green-400">我的推荐码,可以获得佣金</view>
|
||||||
|
|
||||||
|
<!-- #ifdef H5 -->
|
||||||
|
<view class="my-2">
|
||||||
|
<a class="my-2" :href="recommendUrl" target="_blank">{{ recommendUrl }}</a>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- #ifndef H5 -->
|
||||||
|
<view class="my-2 text-left text-sm">{{ recommendUrl }}</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
|
||||||
|
<!-- http://localhost:9000/#/pages/index/request -->
|
||||||
|
<wd-button @click="run" class="my-6">发送请求</wd-button>
|
||||||
|
<view class="h-16">
|
||||||
|
<view v-if="loading">loading...</view>
|
||||||
|
<block v-else>
|
||||||
|
<view class="text-xl">请求数据如下</view>
|
||||||
|
<view class="text-green leading-8">{{ JSON.stringify(data) }}</view>
|
||||||
|
</block>
|
||||||
|
</view>
|
||||||
|
<wd-button type="error" @click="reset" class="my-6" :disabled="!data">重置数据</wd-button>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { getFooAPI, postFooAPI, IFooItem } from '@/service/index/foo'
|
||||||
|
import { findPetsByStatusQueryOptions } from '@/service/app'
|
||||||
|
import { useQuery } from '@tanstack/vue-query'
|
||||||
|
|
||||||
|
const recommendUrl = ref('http://laf.run/signup?code=ohaOgIX')
|
||||||
|
|
||||||
|
// const initialData = {
|
||||||
|
// name: 'initialData',
|
||||||
|
// id: '1234',
|
||||||
|
// }
|
||||||
|
const initialData = undefined
|
||||||
|
// 适合少部分全局性的接口————多个页面都需要的请求接口,额外编写一个 Service 层
|
||||||
|
const { loading, error, data, run } = useRequest<IFooItem>(() => getFooAPI('菲鸽'), {
|
||||||
|
immediate: true,
|
||||||
|
initialData,
|
||||||
|
})
|
||||||
|
|
||||||
|
// 使用 vue-query 的 useQuery 来请求数据,只做参考,是否使用请根据实际情况而定
|
||||||
|
const {
|
||||||
|
data: data2,
|
||||||
|
error: error2,
|
||||||
|
isLoading: isLoading2,
|
||||||
|
refetch,
|
||||||
|
} = useQuery(findPetsByStatusQueryOptions({ params: { status: ['available'] } }))
|
||||||
|
|
||||||
|
const reset = () => {
|
||||||
|
data.value = initialData
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
@ -12,8 +12,6 @@ export const getLastPage = () => {
|
|||||||
return pages[pages.length - 1]
|
return pages[pages.length - 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const tabBarList = tabBar?.list || []
|
|
||||||
|
|
||||||
/** 判断当前页面是否是 tabbar 页 */
|
/** 判断当前页面是否是 tabbar 页 */
|
||||||
export const getIsTabbar = () => {
|
export const getIsTabbar = () => {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user