1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-09-12 16:40:40 +08:00
Files
uni-halo/.agents/skills/uview-pro-vue3/examples/guide/config.md
T
2026-08-31 07:58:23 +08:00

69 lines
1.1 KiB
Markdown

# Configuration
**官方文档**: https://uviewpro.cn
## Instructions
This example demonstrates how to configure uView Pro globally.
### Key Concepts
- Global config options
- ConfigProvider
- Theme configuration
- Component configuration
### Example: Global Config
```javascript
// main.js
import { createSSRApp } from 'vue'
import uView from 'uview-pro'
import App from './App.vue'
export function createApp() {
const app = createSSRApp(App)
app.use(uView, {
locale: 'zh-cn',
theme: 'light'
})
return {
app
}
}
```
### Example: Using ConfigProvider
```vue
<template>
<u-config-provider :theme="theme" :locale="locale">
<u-button>Button</u-button>
</u-config-provider>
</template>
<script setup>
import { ref } from 'vue'
const theme = ref('light')
const locale = ref('zh-cn')
</script>
```
### Example: Component Config
```vue
<template>
<u-button :config="{ size: 'large' }">Button</u-button>
</template>
```
### Key Points
- Configure globally via app.use()
- Use ConfigProvider for component-level config
- Support theme and locale configuration
- Component-level config available
- Follow uni-app configuration patterns