@zfqh/uniapp 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/docs/api/apis/index.md +1 -1
  3. package/docs/api/apis/request.md +9 -9
  4. package/docs/api/configs/index.md +1 -2
  5. package/docs/api/hooks/index.md +4 -4
  6. package/docs/api/index.md +8 -3
  7. package/docs/api/mixins/app.md +1 -2
  8. package/docs/api/modules/app.md +0 -2
  9. package/docs/api/modules/index.md +1 -1
  10. package/docs/api/utils/cos.md +1 -2
  11. package/docs/api/utils/index.md +1 -1
  12. package/docs/api/utils/locale.md +68 -32
  13. package/docs/api/utils/navigate.md +3 -3
  14. package/docs/api/utils/pages.md +1 -1
  15. package/docs/api/utils/request.md +1 -1
  16. package/docs/components/index.md +1 -1
  17. package/docs/components/styles/base-styles.md +239 -367
  18. package/docs/components/usage.md +1 -1
  19. package/docs/faq/index.md +5 -6
  20. package/docs/guide/getting-started.md +3 -4
  21. package/docs/guide/project-frame.md +36 -23
  22. package/docs/index.md +3 -3
  23. package/lib/components/g-back-button/g-back-button.vue +2 -2
  24. package/lib/components/g-checkbox-list/g-checkbox-list.vue +1 -1
  25. package/lib/components/g-float/g-float.vue +1 -1
  26. package/lib/components/g-grid-image/g-grid-image.vue +1 -1
  27. package/lib/components/g-grid-swiper/g-grid-swiper.vue +1 -1
  28. package/lib/components/g-more/g-more.vue +2 -2
  29. package/lib/components/g-page-container/g-page-container.vue +1 -1
  30. package/lib/components/g-popup/g-popup.vue +3 -3
  31. package/lib/components/g-refresh-view/g-refresh-view.vue +1 -1
  32. package/lib/components/g-search/g-search.vue +4 -4
  33. package/lib/components/g-share-photo/g-share-photo.vue +1 -1
  34. package/lib/components/g-share-view/g-share-view.vue +2 -2
  35. package/lib/components/g-share-weixin/g-share-weixin.vue +1 -1
  36. package/lib/components/g-tag-editor/g-tag-editor.vue +2 -2
  37. package/lib/components/g-trtc-room/g-trtc-room.vue +1 -1
  38. package/lib/hooks/useI18n.js +1 -7
  39. package/lib/index.d.ts +1 -0
  40. package/lib/index.js +1 -2
  41. package/lib/styles/bg.scss +1 -22
  42. package/lib/styles/border.scss +1 -158
  43. package/lib/styles/{flex-vue.scss → flex.scss} +15 -12
  44. package/lib/styles/index.scss +5 -17
  45. package/lib/styles/layout.scss +17 -75
  46. package/lib/styles/reset-vue.scss +3 -1
  47. package/lib/styles/text-nvue.scss +1 -10
  48. package/lib/styles/text-vue.scss +0 -55
  49. package/lib/styles/text.scss +1 -43
  50. package/lib/styles/var.module.scss +1 -0
  51. package/lib/utils/locale.d.ts +3 -4
  52. package/lib/utils/locale.js +6 -15
  53. package/package.json +3 -3
  54. package/types/index.d.ts +4 -2
  55. package/lib/styles/animate-vue.scss +0 -3
  56. package/lib/styles/animate.scss +0 -27
  57. package/lib/styles/bg-vue.scss +0 -21
  58. package/lib/styles/flex-nvue.scss +0 -64
  59. package/lib/styles/font.scss +0 -59
  60. package/lib/styles/layout-nvue.scss +0 -24
  61. package/lib/styles/layout-vue.scss +0 -30
  62. package/lib/styles/opacity.scss +0 -10
  63. package/lib/styles/shadow.scss +0 -12
  64. package/lib/styles/sizing-vue.scss +0 -21
  65. package/lib/styles/sizing.scss +0 -21
  66. package/lib/styles/spacing.scss +0 -234
@@ -34,14 +34,14 @@ export function createApp() {
34
34
  }
35
35
  ```
36
36
 
37
- `@zfqh/uniapp` 插件安装时会把 `app.config.globalProperties.$store` 赋值给 `uni.$store`。请求、导航、权限、登录等能力会读取 `uni.$store`,所以请先挂载 store,再注册本插件。
37
+ 请求、导航、权限、登录等能力会读取 store 状态,所以请先挂载 store,再注册本插件。
38
38
 
39
39
  Store 使用入口请按上下文区分:
40
40
 
41
41
  - 组件的 Composition API 或 `<script setup>` 中使用 `import { useStore } from 'vuex'`。
42
42
  - 自定义 hooks / composables 中也使用 `useStore()`。
43
43
  - Options API 组件中可使用 `this.$store`。
44
- - 请求、导航、权限、webview 消息等普通 TS 模块中使用 `uni.$store`。
44
+ - 普通 TS 模块中使用 `uni.$store`。
45
45
 
46
46
  详见 [Store 使用位置](./project-frame.md#store-使用位置)。
47
47
 
@@ -124,7 +124,6 @@ import { defineConfig } from '@zfqh/uniapp';
124
124
  import { app } from '@zfqh/uniapp/lib/configs/app';
125
125
  import { brand } from '@zfqh/uniapp/lib/configs/brand';
126
126
  import { getTencentToken } from '@zfqh/uniapp/lib/apis';
127
- import store from '@/store';
128
127
 
129
128
  defineConfig({
130
129
  app: app.merchant,
@@ -149,7 +148,7 @@ defineConfig({
149
148
  create_time: data.createTime,
150
149
  expire_time: data.expirationTime,
151
150
  bucket: data.bucket,
152
- region: store.state.storeConfig.isGlobalAccelerate ? 'accelerate' : data.region,
151
+ region: uni.$store.state.storeConfig.isGlobalAccelerate ? 'accelerate' : data.region,
153
152
  };
154
153
  },
155
154
  },
@@ -110,7 +110,6 @@ import { defineConfig } from '@zfqh/uniapp';
110
110
  import { app } from '@zfqh/uniapp/lib/configs/app';
111
111
  import { brand } from '@zfqh/uniapp/lib/configs/brand';
112
112
  import { getTencentToken } from '@zfqh/uniapp/lib/apis';
113
- import store from '@/store';
114
113
 
115
114
  defineConfig({
116
115
  app: app.merchant,
@@ -135,7 +134,7 @@ defineConfig({
135
134
  create_time: data.createTime,
136
135
  expire_time: data.expirationTime,
137
136
  bucket: data.bucket,
138
- region: store.state.storeConfig.isGlobalAccelerate ? 'accelerate' : data.region,
137
+ region: uni.$store.state.storeConfig.isGlobalAccelerate ? 'accelerate' : data.region,
139
138
  };
140
139
  },
141
140
  },
@@ -197,13 +196,13 @@ export default defineConfig({
197
196
 
198
197
  | 路径 | 用途 |
199
198
  | --- | --- |
200
- | `uni.$store.state.login.info.token` | 请求拦截器注入 `Authorization`。 |
201
- | `uni.$store.state.login.info.tenantId` | 业务请求注入 `Tenant-Id`。 |
202
- | `uni.$store.state.system.info.appLanguage` | 业务请求注入 `X-Language`。 |
203
- | `uni.$store.state.system.info.appVersion` | 非 App 环境下读取版本名。 |
204
- | `uni.$store.state.system.info.appVersionCode` | 非 App 环境下读取版本号。 |
205
- | `uni.$store.getters.isLogin` | 导航登录拦截判断。 |
206
- | `uni.$store.dispatch('logout')` | `401` 时触发退出登录。 |
199
+ | `store.state.login.info.token` | 请求拦截器注入 `Authorization`。 |
200
+ | `store.state.login.info.tenantId` | 业务请求注入 `Tenant-Id`。 |
201
+ | `store.state.system.info.appLanguage` | 业务请求注入 `X-Language`。 |
202
+ | `store.state.system.info.appVersion` | 非 App 环境下读取版本名。 |
203
+ | `store.state.system.info.appVersionCode` | 非 App 环境下读取版本号。 |
204
+ | `store.getters.isLogin` | 导航登录拦截判断。 |
205
+ | `store.dispatch('logout')` | `401` 时触发退出登录。 |
207
206
 
208
207
  推荐在注册插件前完成:
209
208
 
@@ -219,9 +218,9 @@ app.use(uniapp);
219
218
  | 场景 | 推荐用法 | 说明 |
220
219
  | --- | --- | --- |
221
220
  | Vue 组件的 Composition API / `<script setup>` | `import { useStore } from 'vuex'` 后调用 `const store = useStore()` | 组件实例处于 Vue 上下文内,应使用 Vuex 官方组合式 API,便于类型推导、测试和组件复用。 |
222
- | 自定义 hooks / composables | `import { useStore } from 'vuex'` 后在 hook 内调用 `useStore()` | hooks 同样运行在组件 setup 上下文里,不要直接读取全局 `uni.$store`。 |
221
+ | 自定义 hooks / composables | `import { useStore } from 'vuex'` 后在 hook 内调用 `useStore()` | hooks 同样运行在组件 setup 上下文里。 |
223
222
  | Options API 组件 | `this.$store` | 组件实例已注入 `$store` 时可使用实例属性;现有 `g-*` 组件源码也采用这种方式读取部分系统状态。 |
224
- | 请求、导航、toast、权限、webview 消息等普通 TS 模块 | `uni.$store` | 这些模块不在 Vue setup 上下文中,无法调用 `useStore()`,因此通过插件挂载到 `uni.$store` 的全局 store 读取登录态和全局状态。 |
223
+ | 请求、导航、toast、权限、webview 消息等普通 TS 模块 | `uni.$store` | 这些模块不在 Vue setup 上下文中,无法调用 `useStore()`,因此直接引入 store 实例读取登录态和全局状态。 |
225
224
 
226
225
  组件或 hooks 中推荐写法:
227
226
 
@@ -241,27 +240,41 @@ export function useLoginInfo() {
241
240
  }
242
241
  ```
243
242
 
244
- 普通模块中推荐写法:
245
-
246
- ```ts
247
- export function getToken() {
248
- return uni.$store?.state?.login?.info?.token;
249
- }
250
- ```
251
-
252
- `uni.$store` 是为了让脱离组件树的工具函数能够访问 store,不建议在组件 setup 或 hooks 中把它作为首选入口。
253
-
254
243
  ## 样式接入
255
244
 
256
- `@zfqh/uniapp` 提供一套 UnoCSS 风格的工具样式类,需要在项目全局样式中导入一次:
245
+ `@zfqh/uniapp` 内置的静态样式仅覆盖平台差异类和使用 `$uv-*` SCSS 变量的语义色类,间距、尺寸、字号、圆角、透明度、阴影等通用原子类由 `@gmcb/vite` 的 unocss 插件在构建时动态生成。
246
+
247
+ 在项目全局样式中导入静态样式,放在 `App.vue` 的 `<style>` 块:
257
248
 
258
249
  ```scss
259
- /* App.vue 的 <style> 块 */
260
250
  @import '@zfqh/uniapp/lib/styles/index.scss';
261
251
  ```
262
252
 
263
253
  此入口同时引入 `@gmcb/uv-ui/index.scss`,无需再单独导入 uv-ui 基础样式。
264
254
 
255
+ ### 配置 unocss 插件
256
+
257
+ 在 `vite.config.js` 中注册 unocss 插件,并传入 `blockList` 避免与内置静态类名冲突:
258
+
259
+ ```js
260
+ import { join } from 'path';
261
+ import { defineConfig } from '@gmcb/vite';
262
+ import { unocss } from '@gmcb/vite/lib/plugins';
263
+ import { blockList } from '@gmcb/vite/lib/unocss';
264
+
265
+ // 解决工程化和非工程化编译兼容问题
266
+ const uni = require(join(process.cwd(), 'node_modules/@dcloudio/vite-plugin-uni')).default;
267
+
268
+ export default defineConfig({
269
+ plugins: [
270
+ uni(),
271
+ unocss({
272
+ blockList,
273
+ }),
274
+ ],
275
+ });
276
+ ```
277
+
265
278
  ### 覆盖 SCSS 主题变量
266
279
 
267
280
  如果项目通过 `defineConfig({ color })` 覆盖了主题色,建议同步覆盖 SCSS 变量,确保 uv-ui 组件和工具类使用一致的颜色。在 `uni.scss` 中先导入 `@gmcb/uv-ui/theme.scss` 默认变量,再声明同名变量覆盖:
package/docs/index.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @zfqh/uniapp
2
2
 
3
- `@zfqh/uniapp` 是面向 uni-app Vue 3 项目的公共能力包,包含配置系统、环境配置、请求封装、导航提示、COS 上传、应用更新、hooks、工具函数、Vuex modules、mixins、`g-*` 公共组件和工具样式类。
3
+ `@zfqh/uniapp` 是面向 uni-app Vue 3 项目的公共能力包,包含配置系统、环境配置、请求封装、导航提示、COS 上传、应用更新、hooks、工具函数、Vuex modules、mixins、`g-*` 公共组件和工具样式类(内置平台差异及语义色类,完整原子类需配合 `@gmcb/vite` 的 unocss 插件使用)。
4
4
 
5
5
  ## 快速入口
6
6
 
@@ -74,7 +74,7 @@ export function createApp() {
74
74
 
75
75
  ## 使用约定
76
76
 
77
- - 项目需要提供符合约定的 Vuex store:请求读取 `uni.$store.state.login.info.token`,导航读取 `uni.$store.getters.isLogin`,`401` 会触发 `uni.$store.dispatch('logout')`。
78
- - Store 入口按上下文区分:组件和 hooks 的 Composition API 中使用 `import { useStore } from 'vuex'`,Options API 组件中使用 `this.$store`,请求、导航、权限、webview 消息等普通模块中使用 `uni.$store`。
77
+ - 项目需要提供符合约定的 Vuex store:请求读取 `store.state.login.info.token`,导航读取 `store.getters.isLogin`,`401` 会触发 `store.dispatch('logout')`。
78
+ - Store 入口按上下文区分:组件的 Composition API 中使用 `import { useStore } from 'vuex'`,Options API 组件中使用 `this.$store`,普通 TS 模块中使用 `uni.$store`。
79
79
  - 多环境配置推荐使用 `@env/.env.<env>.ts`,并通过 `defineEnvConfig` 输出配置。
80
80
  - 根入口未导出的 `apis`、`modules`、`mixins` 请按 [深度引用](./api/index.md#深度引用) 从构建产物路径引入。
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <view class="back-button" :style="[_customStyle]">
3
- <view class="flex justify-center" @click="goBack" :class="[showHome ? '' : 'back']">
3
+ <view class="flex justify-center items-center" @click="goBack" :class="[showHome ? '' : 'back']">
4
4
  <g-icon v-if="showIcon" :type="type" :font="iconFont" :name="iconName" :size="iconSize || 18" :color="color" />
5
5
  <uv-icon v-else :name="iconName" :size="iconSize || 22" :color="color" />
6
6
  </view>
7
- <view v-if="showHome" class="flex justify-center" @click="goHome">
7
+ <view v-if="showHome" class="flex justify-center items-center" @click="goHome">
8
8
  <g-icon
9
9
  v-if="showIcon"
10
10
  :type="type"
@@ -4,7 +4,7 @@
4
4
  <view
5
5
  v-for="(item, index) in dataList"
6
6
  :key="item.key"
7
- class="flex justify-between pr-20rpx"
7
+ class="flex justify-between items-center pr-20rpx"
8
8
  :class="{ 'uv-border-top': border && index > 0 }"
9
9
  :style="[style]"
10
10
  @tap="select(item)"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <view class="float" :style="[style]" @tap.stop="click">
3
3
  <slot>
4
- <g-icon :name="iconName" :font="iconFont" :size="iconSize" :color="iconColor" class="flex" />
4
+ <g-icon :name="iconName" :font="iconFont" :size="iconSize" :color="iconColor" class="flex items-center" />
5
5
  </slot>
6
6
  </view>
7
7
  </template>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <view class="grid" :style="[_style]">
3
3
  <view v-for="(item, index) in list" :key="index" :style="[_imageStyle]" class="overflow-hidden" @tap.stop="click(item)">
4
- <image :src="item.image" style="width: 100%; height: 100%" :mode="mode" class="flex" />
4
+ <image :src="item.image" style="width: 100%; height: 100%" :mode="mode" class="flex items-center" />
5
5
  </view>
6
6
  </view>
7
7
  </template>
@@ -4,7 +4,7 @@
4
4
  <swiper-item v-for="(list, index) in dataList" :key="index">
5
5
  <uv-grid :col="col" :border="false" align="left">
6
6
  <uv-grid-item v-for="(ele, i) in list" :key="i" bgColor="transparent" :customStyle="_colStyle">
7
- <view class="flex justify-center flex-col" :style="[_itemStyle(ele)]" @tap.stop="click(index, i)">
7
+ <view class="flex justify-center items-center flex-col" :style="[_itemStyle(ele)]" @tap.stop="click(index, i)">
8
8
  <uv-image
9
9
  v-if="ele[iconKey]"
10
10
  :src="ele[iconKey]"
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <view :style="[style]">
3
- <view class="flex" @tap.stop="click">
3
+ <view class="flex items-center" @tap.stop="click">
4
4
  <slot name="text">
5
5
  <text> {{ text }} </text>
6
6
  </slot>
7
7
  <slot name="arrow">
8
- <g-icon :name="iconName" :size="iconSize" class="flex" />
8
+ <g-icon :name="iconName" :size="iconSize" class="flex items-center" />
9
9
  </slot>
10
10
  </view>
11
11
  </view>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <view class="container" :style="[containerStyle]">
3
3
  <view v-if="showHeader" class="header" id="page_header" :style="[_headerStyle]">
4
- <view v-if="showNavbar" class="flex justify-center" :style="[_navbarStyle]">
4
+ <view v-if="showNavbar" class="flex justify-center items-center" :style="[_navbarStyle]">
5
5
  <view :style="[_leftStyle]">
6
6
  <g-back-button
7
7
  v-if="showBack"
@@ -20,7 +20,7 @@
20
20
  <view :style="[_customStyle]">
21
21
  <slot v-if="opts.showHeader" name="header">
22
22
  <view
23
- class="flex"
23
+ class="flex items-center"
24
24
  :class="[{ 'border-b': opts.headerBorder }, { 'justify-start': opts.titleAlign === 'left', 'justify-end': opts.titleAlign === 'right', 'justify-center': opts.titleAlign === 'center', 'justify-between': opts.titleAlign === 'between', 'justify-around': opts.titleAlign === 'around' }]"
25
25
  :style="[_headerStyle]"
26
26
  >
@@ -31,7 +31,7 @@
31
31
  </slot>
32
32
  <slot v-if="opts.showContent" name="content">
33
33
  <scroll-view scroll-y :style="[_scrollStyle]">
34
- <view class="flex justify-center break-all" :class="[{ 'text-left': opts.align === 'left', 'text-right': opts.align === 'right', 'text-center': opts.align === 'center' }]" :style="[_contentStyle]">
34
+ <view class="flex justify-center items-center break-all" :class="[{ 'text-left': opts.align === 'left', 'text-right': opts.align === 'right', 'text-center': opts.align === 'center' }]" :style="[_contentStyle]">
35
35
  <slot name="default">
36
36
  <rich-text :nodes="opts.content" />
37
37
  </slot>
@@ -41,7 +41,7 @@
41
41
  <slot v-if="opts.showFooter" name="footer">
42
42
  <view
43
43
  v-if="opts.showConfirm || opts.showCancel"
44
- class="flex justify-center footer"
44
+ class="flex justify-center items-center footer"
45
45
  :class="{ 'border-t': opts.footerBorder }"
46
46
  :style="[_footerStyle]"
47
47
  >
@@ -19,7 +19,7 @@
19
19
  @refresherabort="refresherabort"
20
20
  >
21
21
  <slot v-if="mode === 'none' && enabled" name="refresher">
22
- <view class="w-full flex flex-col justify-center text-tips" :style="[_loadingStyle]">
22
+ <view class="w-full flex flex-col justify-center items-center text-tips" :style="[_loadingStyle]">
23
23
  <slot v-if="completed" name="completeText" :text="completeText">
24
24
  <text> {{ completeText }} </text>
25
25
  </slot>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="search-input flex" @tap="click()" :style="[style]" :class="[shape]">
2
+ <view class="search-input flex items-center" @tap="click()" :style="[style]" :class="[shape]">
3
3
  <slot name="icon">
4
4
  <uv-icon name="search" size="20" class="text-tips" />
5
5
  </slot>
@@ -14,7 +14,7 @@
14
14
  @change="change"
15
15
  >
16
16
  <swiper-item v-for="(keyword, index) in data" :key="index">
17
- <text class="ml-16rpx flex h-full" :style="[_inputStyle, _placeholderStyle]"> {{ keyword }} </text>
17
+ <text class="ml-16rpx flex h-full items-center" :style="[_inputStyle, _placeholderStyle]"> {{ keyword }} </text>
18
18
  </swiper-item>
19
19
  </swiper>
20
20
  <view v-else class="flex-1 ml-16rpx h-full relative">
@@ -33,12 +33,12 @@
33
33
  @input="input()"
34
34
  />
35
35
  <view v-if="clearable" class="search-input-clear" @tap.stop="clear" :style="[closeStyle]">
36
- <uv-icon v-if="keyword" name="close-circle-fill" class="flex text-tips" :size="clearSize" />
36
+ <uv-icon v-if="keyword" name="close-circle-fill" class="flex text-tips items-center" :size="clearSize" />
37
37
  </view>
38
38
  </view>
39
39
  <view v-if="showButton" @tap.stop="search()">
40
40
  <slot name="button">
41
- <view class="flex" :style="[buttonStyle]">
41
+ <view class="flex items-center" :style="[buttonStyle]">
42
42
  <uv-line direction="col" :color="lineColor" length="26" margin="0 16rpx" />
43
43
  <text class="text-26rpx"> 搜索 </text>
44
44
  </view>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="flex justify-center flex-col" :style="[customStyle]" @tap.stop="$uv.throttle(click)">
2
+ <view class="flex justify-center items-center flex-col" :style="[customStyle]" @tap.stop="$uv.throttle(click)">
3
3
  <image :src="url" :style="[style]" mode="heightFix" />
4
4
  <text v-if="text" :style="[textStyle]"> {{ text }} </text>
5
5
  </view>
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <view class="flex flex-col pt-20rpx pl-20rpx pr-20rpx" :style="[customStyle]">
2
+ <view class="flex flex-col items-center pt-20rpx pl-20rpx pr-20rpx" :style="[customStyle]">
3
3
  <view v-if="title" class="w-full pl-20rpx">
4
4
  <text class="font-bold" :style="[titleStyle]"> {{ title }} </text>
5
5
  </view>
6
- <view class="w-full flex flex-wrap">
6
+ <view class="w-full flex flex-wrap items-center">
7
7
  <template v-for="item in buttons" :key="item.type">
8
8
  <g-share-weixin
9
9
  v-if="hasWeixin && item.type === 'weixin'"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <view class="flex justify-center flex-col" :style="[customStyle]" @tap.stop="$uv.throttle(click)">
2
+ <view class="flex justify-center items-center flex-col" :style="[customStyle]" @tap.stop="$uv.throttle(click)">
3
3
  <image :src="url" :style="[style]" mode="heightFix" />
4
4
  <text v-if="text" :style="[textStyle]"> {{ text }} </text>
5
5
  </view>
@@ -11,7 +11,7 @@
11
11
  :customStyle="_tagStyle"
12
12
  @close="removeTag(i)"
13
13
  />
14
- <view v-if="!disabled" class="flex-1 flex" style="min-width: 160rpx">
14
+ <view v-if="!disabled" class="flex-1 flex items-center" style="min-width: 160rpx">
15
15
  <input
16
16
  v-model.trim="content"
17
17
  class="box-border flex-1"
@@ -51,7 +51,7 @@
51
51
  <view v-for="(item, index) in list" :key="index" class="tag-editor-labels">
52
52
  <view v-if="item.title" :style="[titleStyle]"> {{ item.title }} </view>
53
53
  <view v-if="item.list" class="flex items-start">
54
- <view class="flex-1 flex flex-wrap">
54
+ <view class="flex-1 flex flex-wrap items-center">
55
55
  <uv-tags
56
56
  v-for="ele in item.list"
57
57
  :key="ele.label"
@@ -14,7 +14,7 @@
14
14
  </view>
15
15
  <view :style="[titleStyle]">
16
16
  <slot v-if="!start || !enableCamera" name="title">
17
- <view class="flex flex-col justify-center">
17
+ <view class="flex flex-col justify-center items-center">
18
18
  <uv-avatar :src="avatar" size="120rpx" mode="aspectFill" class="u-flex" />
19
19
  <text v-if="title" class="text-28rpx mt-12rpx"> {{ title }} </text>
20
20
  <text v-if="description" :class="[title ? 'mt-6rpx' : 'mt-12rpx']" class="text-24rpx">
@@ -1,16 +1,10 @@
1
- // #ifdef APP-NVUE
2
- import { ref, inject } from 'vue';
3
- import { showLocale, defaultLocale } from '../utils/locale';
4
- // #endif
5
1
  // #ifndef APP-NVUE
6
2
  import { useI18n as vueUseI18n } from 'vue-i18n';
7
3
  // #endif
8
4
  let _useI18n;
9
5
  // #ifdef APP-NVUE
10
6
  _useI18n = function () {
11
- const locale = ref(defaultLocale);
12
- const t = inject('t', showLocale);
13
- return { t, locale };
7
+ return uni.$i18n.global;
14
8
  };
15
9
  // #endif
16
10
  // #ifndef APP-NVUE
package/lib/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import cos from './utils/cos';
5
5
  import './utils/uni';
6
6
  export * from './hooks';
7
7
  export * from './utils';
8
+ export * from './utils/locale';
8
9
  export * from './utils/file';
9
10
  export * from './utils/storage';
10
11
  export * from './utils/pages';
package/lib/index.js CHANGED
@@ -6,6 +6,7 @@ import cos from './utils/cos';
6
6
  import './utils/uni';
7
7
  export * from './hooks';
8
8
  export * from './utils';
9
+ export * from './utils/locale';
9
10
  export * from './utils/file';
10
11
  export * from './utils/storage';
11
12
  export * from './utils/pages';
@@ -25,8 +26,6 @@ const install = (app) => {
25
26
  // #ifdef MP
26
27
  app.mixin(deep);
27
28
  // #endif
28
- const { $store } = app.config.globalProperties;
29
- uni.$store = $store;
30
29
  };
31
30
  export default {
32
31
  install,
@@ -1,12 +1,3 @@
1
- .bg-transparent {
2
- background-color: transparent;
3
- }
4
- .bg-white {
5
- background-color: #ffffff;
6
- }
7
- .bg-black {
8
- background-color: #000000;
9
- }
10
1
  .bg-primary {
11
2
  background-color: $uv-primary;
12
3
  }
@@ -67,24 +58,12 @@
67
58
  .bg-info-disabled {
68
59
  background-color: $uv-info-disabled;
69
60
  }
70
- .bg-main {
71
- background-color: $uv-main-color;
72
- }
73
- .bg-content {
74
- background-color: $uv-content-color;
75
- }
76
- .bg-tips {
77
- background-color: $uv-tips-color;
78
- }
79
- .bg-light {
80
- background-color: $uv-light-color;
81
- }
82
61
  .bg-border {
83
62
  background-color: $uv-border-color;
84
63
  }
85
64
  .bg {
86
65
  background-color: $uv-bg-color;
87
- }
66
+ }
88
67
  .bg-light {
89
68
  background-color: $uv-bg-light-color;
90
69
  }
@@ -8,79 +8,6 @@
8
8
  border-style: solid;
9
9
  border-color: $uv-border-color;
10
10
  }
11
- .border-0 {
12
- border-width: 0;
13
- }
14
- .border-t-0 {
15
- border-top-width: 0;
16
- }
17
- .border-r-0 {
18
- border-right-width: 0;
19
- }
20
- .border-b-0 {
21
- border-bottom-width: 0;
22
- }
23
- .border-l-0 {
24
- border-left-width: 0;
25
- }
26
- @for $i from 1 through 4 {
27
- $s: $i * 2;
28
- .border-width-#{$s}px {
29
- border-width: #{$s}px;
30
- }
31
- .border-width-#{$s}rpx {
32
- border-width: #{$s}rpx;
33
- }
34
- .border-t-width-#{$s}px {
35
- border-top-width: #{$s}px;
36
- }
37
- .border-t-width-#{$s}rpx {
38
- border-top-width: #{$s}rpx;
39
- }
40
- .border-r-width-#{$s}px {
41
- border-right-width: #{$s}px;
42
- }
43
- .border-r-width-#{$s}rpx {
44
- border-right-width: #{$s}rpx;
45
- }
46
- .border-b-width-#{$s}px {
47
- border-bottom-width: #{$s}px;
48
- }
49
- .border-b-width-#{$s}rpx {
50
- border-bottom-width: #{$s}rpx;
51
- }
52
- .border-l-width-#{$s}px {
53
- border-left-width: #{$s}px;
54
- }
55
- .border-l-width-#{$s}rpx {
56
- border-left-width: #{$s}rpx;
57
- }
58
- .border-x-width-#{$s}px {
59
- border-left-width: #{$s}px;
60
- border-right-width: #{$s}px;
61
- }
62
- .border-x-width-#{$s}rpx {
63
- border-left-width: #{$s}rpx;
64
- border-right-width: #{$s}rpx;
65
- }
66
- .border-y-width-#{$s}px {
67
- border-top-width: #{$s}px;
68
- border-bottom-width: #{$s}px;
69
- }
70
- .border-y-width-#{$s}rpx {
71
- border-top-width: #{$s}rpx;
72
- border-bottom-width: #{$s}rpx;
73
- }
74
- }
75
- .border-solid {
76
- border-style: solid;
77
- }
78
- .border-dashed {
79
- border-style: dashed;
80
- }
81
- .border-dotted {
82
- border-style: dotted;
83
- }
84
11
  .border-t {
85
12
  border-top-width: 1px;
86
13
  border-top-style: solid;
@@ -131,88 +58,4 @@
131
58
  }
132
59
  .border-info {
133
60
  border-color: $uv-info;
134
- }
135
- .border-main {
136
- border-color: $uv-main-color;
137
- }
138
- .border-light {
139
- border-color: $uv-light-color;
140
- }
141
- .border-content {
142
- border-color: $uv-content-color;
143
- }
144
- .border-transparent {
145
- border-color: transparent;
146
- }
147
- .rounded-0 {
148
- border-radius: 0;
149
- }
150
- .rounded-full {
151
- border-radius: 9999px;
152
- }
153
-
154
- @for $i from 1 through 50 {
155
- $s: $i * 2;
156
- .rounded-#{$s}px {
157
- border-radius: #{$s}px;
158
- }
159
- .rounded-t-#{$s}px {
160
- border-top-left-radius: #{$s}px;
161
- border-top-right-radius: #{$s}px;
162
- }
163
- .rounded-b-#{$s}px {
164
- border-bottom-left-radius: #{$s}px;
165
- border-bottom-right-radius: #{$s}px;
166
- }
167
- .rounded-l-#{$s}px {
168
- border-top-left-radius: #{$s}px;
169
- border-bottom-left-radius: #{$s}px;
170
- }
171
- .rounded-r-#{$s}px {
172
- border-top-right-radius: #{$s}px;
173
- border-bottom-right-radius: #{$s}px;
174
- }
175
- .rounded-tl-#{$s}px {
176
- border-top-left-radius: #{$s}px;
177
- }
178
- .rounded-tr-#{$s}px {
179
- border-top-right-radius: #{$s}px;
180
- }
181
- .rounded-bl-#{$s}px {
182
- border-bottom-left-radius: #{$s}px;
183
- }
184
- .rounded-br-#{$s}px {
185
- border-bottom-right-radius: #{$s}px;
186
- }
187
- .rounded-#{$s}rpx {
188
- border-radius: #{$s}rpx;
189
- }
190
- .rounded-t-#{$s}rpx {
191
- border-top-left-radius: #{$s}rpx;
192
- border-top-right-radius: #{$s}rpx;
193
- }
194
- .rounded-b-#{$s}rpx {
195
- border-bottom-left-radius: #{$s}rpx;
196
- border-bottom-right-radius: #{$s}rpx;
197
- }
198
- .rounded-l-#{$s}rpx {
199
- border-top-left-radius: #{$s}rpx;
200
- border-bottom-left-radius: #{$s}rpx;
201
- }
202
- .rounded-r-#{$s}rpx {
203
- border-top-right-radius: #{$s}rpx;
204
- border-bottom-right-radius: #{$s}rpx;
205
- }
206
- .rounded-tl-#{$s}rpx {
207
- border-top-left-radius: #{$s}rpx;
208
- }
209
- .rounded-tr-#{$s}rpx {
210
- border-top-right-radius: #{$s}rpx;
211
- }
212
- .rounded-bl-#{$s}rpx {
213
- border-bottom-left-radius: #{$s}rpx;
214
- }
215
- .rounded-br-#{$s}rpx {
216
- border-bottom-right-radius: #{$s}rpx;
217
- }
218
- }
61
+ }
@@ -1,16 +1,17 @@
1
- page {
2
- height: 100%;
3
- display: flex;
4
- flex-direction: column;
5
- .flex {
6
- display: flex;
1
+ /* #ifdef H5 */
2
+ page {
3
+ /* #endif */
4
+ .flex {
5
+ /* #ifndef APP-NVUE */
6
+ display: flex;
7
+ /* #endif */
7
8
  flex-direction: row;
8
- align-items: center;
9
9
  }
10
- .flex-inline {
11
- display: inline-flex;
10
+ .flex-inline {
11
+ /* #ifndef APP-NVUE */
12
+ display: inline-flex;
13
+ /* #endif */
12
14
  flex-direction: row;
13
- align-items: center;
14
15
  }
15
16
  .flex-row {
16
17
  flex-direction: row;
@@ -33,7 +34,7 @@ page {
33
34
  .flex-wrap-reverse {
34
35
  flex-wrap: wrap-reverse;
35
36
  }
36
- @for $n from 0 through 5 {
37
+ @for $n from 0 through 8 {
37
38
  .flex-#{$n} {
38
39
  flex: $n;
39
40
  }
@@ -71,5 +72,7 @@ page {
71
72
  .justify-around {
72
73
  justify-content: space-around;
73
74
  }
74
- }
75
+ /* #ifdef H5 */
76
+ }
77
+ /* #endif */
75
78