Merge branch 'base' into tabbar
This commit is contained in:
commit
137fa5846b
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
@ -7,13 +7,11 @@
|
|||||||
"antfu.unocss",
|
"antfu.unocss",
|
||||||
"antfu.iconify",
|
"antfu.iconify",
|
||||||
"evils.uniapp-vscode",
|
"evils.uniapp-vscode",
|
||||||
"mrmaoddxxaa.create-uniapp-view",
|
|
||||||
"uni-helper.uni-helper-vscode",
|
"uni-helper.uni-helper-vscode",
|
||||||
"uni-helper.uni-app-schemas-vscode",
|
"uni-helper.uni-app-schemas-vscode",
|
||||||
"uni-helper.uni-highlight-vscode",
|
"uni-helper.uni-highlight-vscode",
|
||||||
"uni-helper.uni-ui-snippets-vscode",
|
"uni-helper.uni-ui-snippets-vscode",
|
||||||
"uni-helper.uni-app-snippets-vscode",
|
"uni-helper.uni-app-snippets-vscode",
|
||||||
"uni-helper.uni-cloud-snippets-vscode",
|
|
||||||
"mrmlnc.vscode-json5"
|
"mrmlnc.vscode-json5"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -151,7 +151,6 @@
|
|||||||
"vite": "4.3.5",
|
"vite": "4.3.5",
|
||||||
"vite-plugin-restart": "^0.4.0",
|
"vite-plugin-restart": "^0.4.0",
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
|
||||||
"vite-svg-loader": "^5.1.0",
|
"vite-svg-loader": "^5.1.0",
|
||||||
"vue-tsc": "^1.8.25"
|
"vue-tsc": "^1.8.25"
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,11 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import PLATFORM from '@/utils/platform'
|
import PLATFORM from '@/utils/platform'
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'Home',
|
||||||
|
})
|
||||||
|
|
||||||
// 获取屏幕边界到安全区域距离
|
// 获取屏幕边界到安全区域距离
|
||||||
const { safeAreaInsets } = uni.getSystemInfoSync()
|
const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||||
const author = ref('菲鸽')
|
const author = ref('菲鸽')
|
||||||
|
@ -22,5 +22,13 @@
|
|||||||
"nativeTags": ["block", "template", "component", "slot"]
|
"nativeTags": ["block", "template", "component", "slot"]
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules"],
|
"exclude": ["node_modules"],
|
||||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.json"]
|
"include": [
|
||||||
|
"src/**/*.ts",
|
||||||
|
"src/**/*.js",
|
||||||
|
"src/**/*.d.ts",
|
||||||
|
"src/**/*.tsx",
|
||||||
|
"src/**/*.jsx",
|
||||||
|
"src/**/*.vue",
|
||||||
|
"src/**/*.json"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// uno.config.ts
|
// uno.config.ts
|
||||||
import {
|
import {
|
||||||
Preset,
|
type Preset,
|
||||||
defineConfig,
|
defineConfig,
|
||||||
|
presetUno,
|
||||||
presetAttributify,
|
presetAttributify,
|
||||||
presetIcons,
|
presetIcons,
|
||||||
transformerDirectives,
|
transformerDirectives,
|
||||||
@ -11,28 +12,25 @@ import {
|
|||||||
import { presetApplet, presetRemRpx, transformerAttributify } from 'unocss-applet'
|
import { presetApplet, presetRemRpx, transformerAttributify } from 'unocss-applet'
|
||||||
|
|
||||||
// @see https://unocss.dev/presets/legacy-compat
|
// @see https://unocss.dev/presets/legacy-compat
|
||||||
import presetLegacyCompat from '@unocss/preset-legacy-compat'
|
import { presetLegacyCompat } from '@unocss/preset-legacy-compat'
|
||||||
|
|
||||||
const isH5 = process.env?.UNI_PLATFORM === 'h5'
|
|
||||||
const isMp = process.env?.UNI_PLATFORM?.startsWith('mp') ?? false
|
const isMp = process.env?.UNI_PLATFORM?.startsWith('mp') ?? false
|
||||||
|
|
||||||
const presets: Preset[] = []
|
const presets: Preset[] = []
|
||||||
if (!isMp) {
|
if (isMp) {
|
||||||
/**
|
// 使用小程序预设
|
||||||
* you can add `presetAttributify()` here to enable unocss attributify mode prompt
|
presets.push(presetApplet(), presetRemRpx())
|
||||||
* although preset is not working for applet, but will generate useless css
|
} else {
|
||||||
* 为了不生产无用的css,要过滤掉 applet
|
presets.push(
|
||||||
*/
|
// 非小程序用官方预设
|
||||||
// 支持css class属性化,eg: `<button bg="blue-400 hover:blue-500 dark:blue-500 dark:hover:blue-600" text="sm white">attributify Button</button>`
|
presetUno(),
|
||||||
presets.push(presetAttributify())
|
// 支持css class属性化
|
||||||
}
|
presetAttributify(),
|
||||||
if (!isH5) {
|
)
|
||||||
presets.push(presetRemRpx())
|
|
||||||
}
|
}
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
presets: [
|
presets: [
|
||||||
...presets,
|
...presets,
|
||||||
presetApplet(),
|
|
||||||
// 支持图标,需要搭配图标库,eg: @iconify-json/carbon, 使用 `<button class="i-carbon-sun dark:i-carbon-moon" />`
|
// 支持图标,需要搭配图标库,eg: @iconify-json/carbon, 使用 `<button class="i-carbon-sun dark:i-carbon-moon" />`
|
||||||
presetIcons({
|
presetIcons({
|
||||||
scale: 1.2,
|
scale: 1.2,
|
||||||
|
@ -16,7 +16,6 @@ import UnoCSS from 'unocss/vite'
|
|||||||
// @see https://github.com/jpkleemans/vite-svg-loader
|
// @see https://github.com/jpkleemans/vite-svg-loader
|
||||||
import svgLoader from 'vite-svg-loader'
|
import svgLoader from 'vite-svg-loader'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
|
|
||||||
import { visualizer } from 'rollup-plugin-visualizer'
|
import { visualizer } from 'rollup-plugin-visualizer'
|
||||||
import ViteRestart from 'vite-plugin-restart'
|
import ViteRestart from 'vite-plugin-restart'
|
||||||
|
|
||||||
@ -71,7 +70,6 @@ export default ({ command, mode }) => {
|
|||||||
vueTemplate: true, // default false
|
vueTemplate: true, // default false
|
||||||
}),
|
}),
|
||||||
|
|
||||||
vueSetupExtend(),
|
|
||||||
ViteRestart({
|
ViteRestart({
|
||||||
// 通过这个插件,在修改vite.config.js文件则不需要重新运行也生效配置
|
// 通过这个插件,在修改vite.config.js文件则不需要重新运行也生效配置
|
||||||
restart: ['vite.config.js'],
|
restart: ['vite.config.js'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user