@coffic/cosy-ui 0.6.42 → 0.7.2
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.
- package/dist/alert/{AlertBasicContainer.astro → EAlertBasicContainer.astro} +2 -2
- package/dist/alert/{AlertCustomStyleContainer.astro → EAlertCustomStyleContainer.astro} +2 -2
- package/dist/alert/{AlertTypesContainer.astro → EAlertTypesContainer.astro} +8 -8
- package/dist/alert/{AlertWithTitleContainer.astro → EAlertWithTitleContainer.astro} +2 -2
- package/dist/alert/index.ts +12 -12
- package/dist/app.css +1 -1
- package/dist/button/ButtonBasicContainer.astro +1 -7
- package/dist/button/ButtonLinkContainer.astro +1 -7
- package/dist/button/ButtonSizesContainer.astro +1 -7
- package/dist/button/ButtonVariantsContainer.astro +1 -8
- package/dist/button/ButtonWithIconsContainer.astro +2 -13
- package/dist/button/index_astro.ts +1 -3
- package/dist/code-container/CodeContainer.astro +2 -2
- package/dist/code-container/index.ts +7 -7
- package/dist/container/EContainerBasic.astro +13 -0
- package/dist/container/EContainerBasicContainer.astro +11 -0
- package/dist/container/EContainerFlexBetween.astro +16 -0
- package/dist/container/EContainerFlexCenter.astro +23 -0
- package/dist/container/EContainerFlexColumn.astro +16 -0
- package/dist/container/EContainerFlexContainer.astro +34 -0
- package/dist/container/EContainerFlexRow.astro +16 -0
- package/dist/container/EContainerPadding.astro +32 -0
- package/dist/container/EContainerPaddingContainer.astro +11 -0
- package/dist/container/EContainerSizes.astro +36 -0
- package/dist/container/EContainerSizesContainer.astro +11 -0
- package/dist/container/index.ts +16 -1
- package/dist/footer/{FooterBasic.astro → EFooterBasic.astro} +7 -1
- package/dist/footer/EFooterBasicContainer.astro +11 -0
- package/dist/footer/EFooterComplete.astro +45 -0
- package/dist/footer/EFooterCompleteContainer.astro +11 -0
- package/dist/footer/EFooterFeaturesContainer.astro +40 -0
- package/dist/footer/EFooterWithLogo.astro +23 -0
- package/dist/footer/EFooterWithLogoContainer.astro +11 -0
- package/dist/footer/EFooterWithNavigation.astro +24 -0
- package/dist/footer/EFooterWithNavigationContainer.astro +11 -0
- package/dist/footer/EFooterWithProducts.astro +24 -0
- package/dist/footer/EFooterWithProductsContainer.astro +11 -0
- package/dist/footer/EFooterWithSocial.astro +24 -0
- package/dist/footer/EFooterWithSocialContainer.astro +11 -0
- package/dist/footer/FooterSection.astro +4 -2
- package/dist/footer/index.ts +24 -4
- package/dist/icons/index.ts +3 -0
- package/dist/index_astro.ts +1 -0
- package/package.json +2 -9
- package/dist/button/Button.vue +0 -105
- package/dist/button/ButtonBasic.vue +0 -11
- package/dist/button/ButtonFeature.vue +0 -91
- package/dist/button/ButtonFeatureBasic.vue +0 -8
- package/dist/button/ButtonFeatureContainer.astro +0 -18
- package/dist/button/ButtonFeatureWithTips.vue +0 -7
- package/dist/button/ButtonLink.vue +0 -13
- package/dist/button/ButtonSizes.vue +0 -12
- package/dist/button/ButtonWithIcons.vue +0 -21
- package/dist/button/index_vue.ts +0 -4
- package/dist/vue/AlertDialog/AlertDialog.vue +0 -120
- package/dist/vue/AlertDialog/Basic.vue +0 -38
- package/dist/vue/AlertDialog/Multilang.vue +0 -48
- package/dist/vue/AlertDialog/index.ts +0 -20
- package/dist/vue/BannerBox/BannerBox.vue +0 -296
- package/dist/vue/BannerBox/DownloadButton.vue +0 -202
- package/dist/vue/BannerBox/ExampleBasic.vue +0 -32
- package/dist/vue/BannerBox/ExampleCustomBg.vue +0 -32
- package/dist/vue/BannerBox/ExampleDisplayModeAlways.vue +0 -34
- package/dist/vue/BannerBox/ExampleDisplayModeHover.vue +0 -34
- package/dist/vue/BannerBox/ExampleDisplayModeNever.vue +0 -34
- package/dist/vue/BannerBox/ExampleImageExport.vue +0 -37
- package/dist/vue/BannerBox/ExampleSizePreset.vue +0 -35
- package/dist/vue/BannerBox/FeatureCard.vue +0 -190
- package/dist/vue/BannerBox/SmartBanner.vue +0 -44
- package/dist/vue/BannerBox/bgStyles.ts +0 -55
- package/dist/vue/BannerBox/index.ts +0 -48
- package/dist/vue/BannerBox/sizePresets.ts +0 -23
- package/dist/vue/BlogList/Basic.vue +0 -30
- package/dist/vue/BlogList/BlogList.vue +0 -100
- package/dist/vue/BlogList/Empty.vue +0 -8
- package/dist/vue/BlogList/EmptyEnglish.vue +0 -8
- package/dist/vue/BlogList/English.vue +0 -24
- package/dist/vue/BlogList/index.ts +0 -29
- package/dist/vue/ConfirmDialog/Basic.vue +0 -57
- package/dist/vue/ConfirmDialog/ConfirmDialog.vue +0 -134
- package/dist/vue/ConfirmDialog/CustomButtons.vue +0 -69
- package/dist/vue/ConfirmDialog/index.ts +0 -20
- package/dist/vue/Icons/AlertTriangleIcon.vue +0 -30
- package/dist/vue/Icons/CalendarIcon.vue +0 -30
- package/dist/vue/Icons/CheckCircleIcon.vue +0 -30
- package/dist/vue/Icons/CheckIcon.vue +0 -30
- package/dist/vue/Icons/ChevronDownIcon.vue +0 -30
- package/dist/vue/Icons/ClipboardIcon.vue +0 -30
- package/dist/vue/Icons/CloseIcon.vue +0 -30
- package/dist/vue/Icons/InboxArchiveIcon.vue +0 -30
- package/dist/vue/Icons/InfoCircleIcon.vue +0 -30
- package/dist/vue/Icons/InfoIcon.vue +0 -30
- package/dist/vue/Icons/LinkIcon.vue +0 -30
- package/dist/vue/Icons/MenuIcon.vue +0 -30
- package/dist/vue/Icons/SearchIcon.vue +0 -30
- package/dist/vue/Icons/SettingsIcon.vue +0 -30
- package/dist/vue/Icons/UserIcon.vue +0 -30
- package/dist/vue/Icons/VueIcon.vue +0 -76
- package/dist/vue/Icons/XCircleIcon.vue +0 -30
- package/dist/vue/ListItem.vue +0 -5
- package/dist/vue/MacWindow/Basic.vue +0 -11
- package/dist/vue/MacWindow/CustomHeight.vue +0 -13
- package/dist/vue/MacWindow/MacWindow.vue +0 -262
- package/dist/vue/MacWindow/WithEvents.vue +0 -34
- package/dist/vue/MacWindow/WithSidebar.vue +0 -21
- package/dist/vue/MacWindow/WithTabs.vue +0 -21
- package/dist/vue/MacWindow/WithToolbar.vue +0 -43
- package/dist/vue/MacWindow/index.ts +0 -36
- package/dist/vue/SmartLink.vue +0 -17
- package/dist/vue/TagList.vue +0 -23
- package/dist/vue/VueCounter.vue +0 -29
- package/dist/vue/iPhone/Basic.vue +0 -33
- package/dist/vue/iPhone/CustomBackground.vue +0 -33
- package/dist/vue/iPhone/NoFrame.vue +0 -33
- package/dist/vue/iPhone/WeatherApp.vue +0 -97
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Deep Purple - Landscape.png +0 -0
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Deep Purple - Portrait.png +0 -0
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Gold - Landscape.png +0 -0
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Gold - Portrait.png +0 -0
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Silver - Landscape.png +0 -0
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Silver - Portrait.png +0 -0
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Space Black - Landscape.png +0 -0
- package/dist/vue/iPhone/assets/iPhone 14 Pro - Space Black - Portrait.png +0 -0
- package/dist/vue/iPhone/iPhoneWindow.vue +0 -193
- package/dist/vue/iPhone/index.ts +0 -28
- /package/dist/alert/{AlertBasic.astro → EAlertBasic.astro} +0 -0
- /package/dist/alert/{AlertCustomStyle.astro → EAlertCustomStyle.astro} +0 -0
- /package/dist/alert/{AlertError.astro → EAlertError.astro} +0 -0
- /package/dist/alert/{AlertInfo.astro → EAlertInfo.astro} +0 -0
- /package/dist/alert/{AlertSuccess.astro → EAlertSuccess.astro} +0 -0
- /package/dist/alert/{AlertWarning.astro → EAlertWarning.astro} +0 -0
- /package/dist/alert/{AlertWithTitle.astro → EAlertWithTitle.astro} +0 -0
- /package/dist/code-container/{CodeContainerBasic.astro → ECodeContainerBasic.astro} +0 -0
- /package/dist/code-container/{CodeContainerMultiple.astro → ECodeContainerMultiple.astro} +0 -0
package/dist/vue/TagList.vue
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
<template>
|
2
|
-
<div class="flex flex-col gap-1 card bg-base-100 shadow-xl p-4 rounded-md">
|
3
|
-
<a
|
4
|
-
v-for="tag in tags"
|
5
|
-
:key="tag"
|
6
|
-
:href="`/blogs/tags/${tag}`"
|
7
|
-
class="badge badge-primary no-underline"
|
8
|
-
>
|
9
|
-
{{ tag }}
|
10
|
-
</a>
|
11
|
-
</div>
|
12
|
-
</template>
|
13
|
-
|
14
|
-
<script>
|
15
|
-
export default {
|
16
|
-
props: {
|
17
|
-
tags: {
|
18
|
-
type: Array,
|
19
|
-
required: true
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
23
|
-
</script>
|
package/dist/vue/VueCounter.vue
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
<!-- 简单的Vue计数器组件 -->
|
2
|
-
<script setup lang="ts">
|
3
|
-
import { ref } from 'vue';
|
4
|
-
|
5
|
-
const count = ref(0);
|
6
|
-
|
7
|
-
const increment = () => {
|
8
|
-
count.value++;
|
9
|
-
};
|
10
|
-
|
11
|
-
const decrement = () => {
|
12
|
-
count.value--;
|
13
|
-
};
|
14
|
-
</script>
|
15
|
-
|
16
|
-
<template>
|
17
|
-
<div class="cosy:p-4 cosy:bg-base-200 cosy:rounded-lg cosy:shadow-md cosy:max-w-xs cosy:mx-auto">
|
18
|
-
<h2 class="cosy:text-xl cosy:font-bold cosy:mb-4 cosy:text-center">Vue 计数器测试</h2>
|
19
|
-
<div class="cosy:flex cosy:items-center cosy:justify-center cosy:gap-4">
|
20
|
-
<button @click="decrement" class="cosy:btn cosy:btn-primary">
|
21
|
-
-
|
22
|
-
</button>
|
23
|
-
<span class="cosy:text-2xl cosy:font-bold">{{ count }}</span>
|
24
|
-
<button @click="increment" class="cosy:btn cosy:btn-primary">
|
25
|
-
+
|
26
|
-
</button>
|
27
|
-
</div>
|
28
|
-
</div>
|
29
|
-
</template>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
@component iPhoneWindow.Basic
|
3
|
-
|
4
|
-
@description
|
5
|
-
iPhoneWindow 组件的基础示例,展示最基本的 iPhone 窗口外观。
|
6
|
-
|
7
|
-
@usage
|
8
|
-
```vue
|
9
|
-
<iPhoneWindowExamples.Basic />
|
10
|
-
```
|
11
|
-
-->
|
12
|
-
|
13
|
-
<script lang="ts">
|
14
|
-
import '../../app.css'
|
15
|
-
import { defineComponent } from 'vue'
|
16
|
-
import iPhoneWindow from './iPhoneWindow.vue'
|
17
|
-
|
18
|
-
export default defineComponent({
|
19
|
-
name: 'iPhoneWindowBasicExample',
|
20
|
-
components: {
|
21
|
-
iPhoneWindow
|
22
|
-
}
|
23
|
-
})
|
24
|
-
</script>
|
25
|
-
|
26
|
-
<template>
|
27
|
-
<iPhoneWindow>
|
28
|
-
<div class="cosy:p-4 cosy:text-center">
|
29
|
-
<h2 class="cosy:text-xl cosy:font-bold cosy:mb-2">我的应用</h2>
|
30
|
-
<p>这是一个 iPhone 风格的应用界面</p>
|
31
|
-
</div>
|
32
|
-
</iPhoneWindow>
|
33
|
-
</template>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
@component iPhoneWindow.CustomBackground
|
3
|
-
|
4
|
-
@description
|
5
|
-
自定义背景色的 iPhone 窗口示例,展示如何设置不同的背景色。
|
6
|
-
|
7
|
-
@usage
|
8
|
-
```vue
|
9
|
-
<iPhoneWindowExamples.CustomBackground />
|
10
|
-
```
|
11
|
-
-->
|
12
|
-
|
13
|
-
<script lang="ts">
|
14
|
-
import '../../app.css'
|
15
|
-
import { defineComponent } from 'vue'
|
16
|
-
import iPhoneWindow from './iPhoneWindow.vue'
|
17
|
-
|
18
|
-
export default defineComponent({
|
19
|
-
name: 'iPhoneWindowCustomBackgroundExample',
|
20
|
-
components: {
|
21
|
-
iPhoneWindow
|
22
|
-
}
|
23
|
-
})
|
24
|
-
</script>
|
25
|
-
|
26
|
-
<template>
|
27
|
-
<iPhoneWindow backgroundColor="cosy:bg-blue-50">
|
28
|
-
<div class="cosy:p-4 cosy:text-center">
|
29
|
-
<h2 class="cosy:text-xl cosy:font-bold cosy:mb-2 cosy:text-blue-800">蓝色主题</h2>
|
30
|
-
<p class="cosy:text-blue-600">自定义背景色的应用界面</p>
|
31
|
-
</div>
|
32
|
-
</iPhoneWindow>
|
33
|
-
</template>
|
@@ -1,33 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
@component iPhoneWindow.NoFrame
|
3
|
-
|
4
|
-
@description
|
5
|
-
不显示边框的 iPhone 窗口示例,只展示内容区域。
|
6
|
-
|
7
|
-
@usage
|
8
|
-
```vue
|
9
|
-
<iPhoneWindowExamples.NoFrame />
|
10
|
-
```
|
11
|
-
-->
|
12
|
-
|
13
|
-
<script lang="ts">
|
14
|
-
import '../../app.css'
|
15
|
-
import { defineComponent } from 'vue'
|
16
|
-
import iPhoneWindow from './iPhoneWindow.vue'
|
17
|
-
|
18
|
-
export default defineComponent({
|
19
|
-
name: 'iPhoneWindowNoFrameExample',
|
20
|
-
components: {
|
21
|
-
iPhoneWindow
|
22
|
-
}
|
23
|
-
})
|
24
|
-
</script>
|
25
|
-
|
26
|
-
<template>
|
27
|
-
<iPhoneWindow :showFrame="false">
|
28
|
-
<div class="cosy:p-4 cosy:text-center">
|
29
|
-
<h2 class="cosy:text-xl cosy:font-bold cosy:mb-2">纯界面模式</h2>
|
30
|
-
<p>不显示 iPhone 边框,只展示内容</p>
|
31
|
-
</div>
|
32
|
-
</iPhoneWindow>
|
33
|
-
</template>
|
@@ -1,97 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
@component iPhoneWindow.WeatherApp
|
3
|
-
|
4
|
-
@description
|
5
|
-
天气应用示例,展示一个更复杂的 iPhone 应用界面,包含标题栏、主内容区和底部导航。
|
6
|
-
|
7
|
-
@usage
|
8
|
-
```vue
|
9
|
-
<iPhoneWindowExamples.WeatherApp />
|
10
|
-
```
|
11
|
-
-->
|
12
|
-
|
13
|
-
<script lang="ts">
|
14
|
-
import '../../app.css'
|
15
|
-
import { defineComponent } from 'vue'
|
16
|
-
import iPhoneWindow from './iPhoneWindow.vue'
|
17
|
-
|
18
|
-
export default defineComponent({
|
19
|
-
name: 'iPhoneWindowWeatherAppExample',
|
20
|
-
components: {
|
21
|
-
iPhoneWindow
|
22
|
-
}
|
23
|
-
})
|
24
|
-
</script>
|
25
|
-
|
26
|
-
<template>
|
27
|
-
<iPhoneWindow>
|
28
|
-
<div class="cosy:flex cosy:flex-col cosy:h-full">
|
29
|
-
<!-- 应用标题栏 -->
|
30
|
-
<div
|
31
|
-
class="cosy:bg-primary cosy:text-white cosy:px-4 cosy:py-3 cosy:flex cosy:items-center cosy:justify-between">
|
32
|
-
<h2 class="cosy:font-medium">天气预报</h2>
|
33
|
-
<button class="cosy:btn cosy:btn-ghost cosy:btn-sm cosy:p-1">
|
34
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="cosy:h-5 cosy:w-5" viewBox="0 0 20 20"
|
35
|
-
fill="currentColor">
|
36
|
-
<path fill-rule="evenodd"
|
37
|
-
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm0 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
38
|
-
clip-rule="evenodd" />
|
39
|
-
</svg>
|
40
|
-
</button>
|
41
|
-
</div>
|
42
|
-
|
43
|
-
<!-- 主要内容 -->
|
44
|
-
<div class="cosy:flex-1 cosy:p-4 cosy:bg-gradient-to-b cosy:from-blue-400 cosy:to-blue-600">
|
45
|
-
<div class="cosy:text-center cosy:text-white">
|
46
|
-
<div class="cosy:text-5xl cosy:font-light cosy:mb-2">23°</div>
|
47
|
-
<div class="cosy:text-xl cosy:mb-4">晴朗</div>
|
48
|
-
<div class="cosy:text-sm cosy:opacity-90">上海市,今天</div>
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<div class="cosy:mt-8 cosy:bg-white/20 cosy:backdrop-blur-sm cosy:rounded-xl cosy:p-4">
|
52
|
-
<div class="cosy:grid cosy:grid-cols-3 cosy:gap-4 cosy:text-center cosy:text-white">
|
53
|
-
<div>
|
54
|
-
<div class="cosy:text-sm cosy:opacity-80">湿度</div>
|
55
|
-
<div class="cosy:font-medium">68%</div>
|
56
|
-
</div>
|
57
|
-
<div>
|
58
|
-
<div class="cosy:text-sm cosy:opacity-80">风速</div>
|
59
|
-
<div class="cosy:font-medium">8 km/h</div>
|
60
|
-
</div>
|
61
|
-
<div>
|
62
|
-
<div class="cosy:text-sm cosy:opacity-80">能见度</div>
|
63
|
-
<div class="cosy:font-medium">10 km</div>
|
64
|
-
</div>
|
65
|
-
</div>
|
66
|
-
</div>
|
67
|
-
</div>
|
68
|
-
|
69
|
-
<!-- 底部导航 -->
|
70
|
-
<div class="cosy:bg-white cosy:border-t cosy:border-gray-200 cosy:flex cosy:justify-around cosy:py-2">
|
71
|
-
<button class="cosy:p-2 cosy:text-primary">
|
72
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="cosy:h-6 cosy:w-6" fill="none" viewBox="0 0 24 24"
|
73
|
-
stroke="currentColor">
|
74
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
75
|
-
d="M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" />
|
76
|
-
</svg>
|
77
|
-
</button>
|
78
|
-
<button class="cosy:p-2">
|
79
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="cosy:h-6 cosy:w-6" fill="none" viewBox="0 0 24 24"
|
80
|
-
stroke="currentColor">
|
81
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
82
|
-
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
83
|
-
</svg>
|
84
|
-
</button>
|
85
|
-
<button class="cosy:p-2">
|
86
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="cosy:h-6 cosy:w-6" fill="none" viewBox="0 0 24 24"
|
87
|
-
stroke="currentColor">
|
88
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
89
|
-
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
90
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
91
|
-
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
92
|
-
</svg>
|
93
|
-
</button>
|
94
|
-
</div>
|
95
|
-
</div>
|
96
|
-
</iPhoneWindow>
|
97
|
-
</template>
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,193 +0,0 @@
|
|
1
|
-
<!--
|
2
|
-
@component iPhoneWindow
|
3
|
-
|
4
|
-
@description
|
5
|
-
iPhoneWindow 组件模拟 iPhone 设备的外观,包含状态栏、时间显示和设备边框。
|
6
|
-
适用于创建移动应用界面原型或展示移动端设计效果。
|
7
|
-
|
8
|
-
@usage
|
9
|
-
基本用法:
|
10
|
-
```vue
|
11
|
-
<iPhoneWindow>
|
12
|
-
<div>应用内容</div>
|
13
|
-
</iPhoneWindow>
|
14
|
-
```
|
15
|
-
|
16
|
-
不显示边框:
|
17
|
-
```vue
|
18
|
-
<iPhoneWindow :showFrame="false">
|
19
|
-
<div>应用内容</div>
|
20
|
-
</iPhoneWindow>
|
21
|
-
```
|
22
|
-
|
23
|
-
自定义背景色:
|
24
|
-
```vue
|
25
|
-
<iPhoneWindow backgroundColor="bg-blue-50">
|
26
|
-
<div>应用内容</div>
|
27
|
-
</iPhoneWindow>
|
28
|
-
```
|
29
|
-
|
30
|
-
@props
|
31
|
-
@prop {String} [height='h-96'] - 窗口高度
|
32
|
-
@prop {String} [title=''] - 窗口标题
|
33
|
-
@prop {Array} [statusBarButtons=[]] - 状态栏按钮数组
|
34
|
-
@prop {Boolean} [withShadow=true] - 是否显示阴影效果
|
35
|
-
@prop {Boolean} [showFrame=true] - 是否显示 iPhone 边框
|
36
|
-
@prop {String} [backgroundColor=''] - 内容区域背景色
|
37
|
-
|
38
|
-
@slots
|
39
|
-
@slot default - 主要内容区域
|
40
|
-
|
41
|
-
@emits
|
42
|
-
-->
|
43
|
-
<script lang="ts">
|
44
|
-
import '../../style.ts'
|
45
|
-
import { AlertDialog } from '../../index_vue'
|
46
|
-
import { ref, onMounted, onUnmounted, defineComponent } from 'vue'
|
47
|
-
// 导入内部图片资源
|
48
|
-
import iphoneFrame from './assets/iPhone 14 Pro - Deep Purple - Portrait.png'
|
49
|
-
|
50
|
-
export default defineComponent({
|
51
|
-
name: 'iPhoneWindow',
|
52
|
-
components: {
|
53
|
-
AlertDialog
|
54
|
-
},
|
55
|
-
props: {
|
56
|
-
height: {
|
57
|
-
type: String,
|
58
|
-
default: 'h-96'
|
59
|
-
},
|
60
|
-
title: {
|
61
|
-
type: String,
|
62
|
-
default: ''
|
63
|
-
},
|
64
|
-
statusBarButtons: {
|
65
|
-
type: Array,
|
66
|
-
default: () => []
|
67
|
-
},
|
68
|
-
withShadow: {
|
69
|
-
type: Boolean,
|
70
|
-
default: true
|
71
|
-
},
|
72
|
-
showFrame: {
|
73
|
-
type: Boolean,
|
74
|
-
default: true
|
75
|
-
},
|
76
|
-
backgroundColor: {
|
77
|
-
type: String,
|
78
|
-
default: ''
|
79
|
-
}
|
80
|
-
},
|
81
|
-
setup() {
|
82
|
-
const showAlertDialog = ref(false)
|
83
|
-
const alertMessage = ref('')
|
84
|
-
const currentTime = ref('12:00')
|
85
|
-
|
86
|
-
// 获取图片URL
|
87
|
-
const frameSrc = typeof iphoneFrame === 'string' ? iphoneFrame : iphoneFrame.src
|
88
|
-
|
89
|
-
// 更新时间的函数
|
90
|
-
const updateTime = () => {
|
91
|
-
const now = new Date()
|
92
|
-
const hours = now.getHours().toString().padStart(2, '0')
|
93
|
-
const minutes = now.getMinutes().toString().padStart(2, '0')
|
94
|
-
currentTime.value = `${hours}:${minutes}`
|
95
|
-
}
|
96
|
-
|
97
|
-
// 设置定时器更新时间
|
98
|
-
let timeInterval: number
|
99
|
-
onMounted(() => {
|
100
|
-
updateTime()
|
101
|
-
timeInterval = window.setInterval(updateTime, 60000) // 每分钟更新一次
|
102
|
-
})
|
103
|
-
|
104
|
-
onUnmounted(() => {
|
105
|
-
if (timeInterval) {
|
106
|
-
clearInterval(timeInterval)
|
107
|
-
}
|
108
|
-
})
|
109
|
-
|
110
|
-
return {
|
111
|
-
showAlertDialog,
|
112
|
-
alertMessage,
|
113
|
-
currentTime,
|
114
|
-
frameSrc
|
115
|
-
}
|
116
|
-
}
|
117
|
-
})
|
118
|
-
</script>
|
119
|
-
|
120
|
-
<template>
|
121
|
-
<div class="cosy:relative cosy:w-full">
|
122
|
-
<div class="cosy:relative cosy:aspect-[9/19.5]">
|
123
|
-
<!-- iPhone 边框 (放在最底层) -->
|
124
|
-
<img v-if="showFrame" :src="frameSrc" alt="iPhone frame"
|
125
|
-
class="cosy:absolute cosy:inset-0 cosy:w-full cosy:h-full cosy:object-contain">
|
126
|
-
|
127
|
-
<!-- 内容区域 -->
|
128
|
-
<div :class="[
|
129
|
-
'cosy:absolute cosy:inset-0',
|
130
|
-
showFrame ? 'cosy:px-[6%] cosy:pt-[13%] cosy:pb-[13%]' : '',
|
131
|
-
]">
|
132
|
-
<div :class="[
|
133
|
-
'cosy:w-full cosy:h-full cosy:flex cosy:flex-col cosy:overflow-hidden',
|
134
|
-
showFrame ? 'cosy:rounded-t-[2.5em] cosy:rounded-b-[2.5rem]' : 'cosy:rounded-lg cosy:shadow',
|
135
|
-
backgroundColor || 'cosy:bg-transparent'
|
136
|
-
]">
|
137
|
-
<!-- 顶部状态栏 (z-index 设为负数,确保在边框下方) -->
|
138
|
-
<div class="cosy:flex-none cosy:h-12 cosy:px-4 cosy:z-0 cosy:relative">
|
139
|
-
<div class="cosy:flex cosy:items-center cosy:h-full cosy:justify-between">
|
140
|
-
<!-- 左侧时间 -->
|
141
|
-
<div class="cosy:flex cosy:items-center">
|
142
|
-
<span
|
143
|
-
class="cosy:text-sm cosy:font-medium cosy:text-gray-700 cosy:dark:text-gray-200">{{
|
144
|
-
currentTime
|
145
|
-
}}</span>
|
146
|
-
</div>
|
147
|
-
<!-- 右侧状态图标 -->
|
148
|
-
<div class="cosy:flex cosy:items-center cosy:space-x-1.5">
|
149
|
-
<!-- 信号图标 -->
|
150
|
-
<svg class="cosy:w-5 cosy:h-3.5 cosy:text-gray-700 cosy:dark:text-gray-200"
|
151
|
-
viewBox="0 0 20 12" fill="none" stroke="currentColor">
|
152
|
-
<path d="M1 11h2V6H1v5zm4 0h2V4H5v7zm4 0h2V2H9v9zm4 0h2V0h-2v11z"
|
153
|
-
fill="currentColor" />
|
154
|
-
<path d="M17 11h2V0h-2v11z" fill="currentColor" opacity="0.4" />
|
155
|
-
</svg>
|
156
|
-
<!-- Wi-Fi图标 -->
|
157
|
-
<svg class="cosy:w-5 cosy:h-4 cosy:text-gray-700 cosy:dark:text-gray-200"
|
158
|
-
viewBox="0 0 16 12" fill="currentColor">
|
159
|
-
<path
|
160
|
-
d="M8 10.5a1 1 0 100-2 1 1 0 000 2zM4.25 7.25a5 5 0 017.5 0l-1.06 1.06a3.5 3.5 0 00-5.38 0L4.25 7.25z" />
|
161
|
-
<path d="M1.75 4.75a8.5 8.5 0 0112.5 0l-1.06 1.06a7 7 0 00-10.38 0L1.75 4.75z" />
|
162
|
-
</svg>
|
163
|
-
<!-- 电池图标 -->
|
164
|
-
<div class="cosy:flex cosy:items-center cosy:space-x-0.5">
|
165
|
-
<svg class="cosy:w-6 cosy:h-3.5 cosy:text-gray-700 cosy:dark:text-gray-200"
|
166
|
-
viewBox="0 0 25 12" fill="none" stroke="currentColor">
|
167
|
-
<rect x="0.5" y="0.5" width="21" height="11" rx="2.5" stroke-width="1" />
|
168
|
-
<rect x="2" y="2" width="18" height="8" rx="1" fill="currentColor" />
|
169
|
-
<path d="M23 4h1a1 1 0 011 1v2a1 1 0 01-1 1h-1V4z" fill="currentColor" />
|
170
|
-
</svg>
|
171
|
-
</div>
|
172
|
-
</div>
|
173
|
-
</div>
|
174
|
-
</div>
|
175
|
-
|
176
|
-
<!-- 主要内容区域 -->
|
177
|
-
<div class="cosy:flex-1 cosy:flex cosy:flex-col cosy:overflow-hidden cosy:relative">
|
178
|
-
<slot />
|
179
|
-
</div>
|
180
|
-
</div>
|
181
|
-
</div>
|
182
|
-
</div>
|
183
|
-
</div>
|
184
|
-
<!-- 添加 AlertDialog 组件 -->
|
185
|
-
<AlertDialog v-model="showAlertDialog" :message="alertMessage" />
|
186
|
-
</template>
|
187
|
-
|
188
|
-
<style scoped>
|
189
|
-
/* 确保图标渲染更平滑 */
|
190
|
-
svg {
|
191
|
-
shape-rendering: geometricPrecision;
|
192
|
-
}
|
193
|
-
</style>
|
package/dist/vue/iPhone/index.ts
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import Basic from './Basic.vue';
|
2
|
-
import WeatherApp from './WeatherApp.vue';
|
3
|
-
import NoFrame from './NoFrame.vue';
|
4
|
-
import CustomBackground from './CustomBackground.vue';
|
5
|
-
import BasicSource from './Basic.vue?raw';
|
6
|
-
import NoFrameSource from './NoFrame.vue?raw';
|
7
|
-
import CustomBackgroundSource from './CustomBackground.vue?raw';
|
8
|
-
import WeatherAppSource from './WeatherApp.vue?raw';
|
9
|
-
import { extractSimpleExample } from '../../utils/component';
|
10
|
-
|
11
|
-
// 导出主组件
|
12
|
-
export { default as iPhoneWindow } from './iPhoneWindow.vue';
|
13
|
-
|
14
|
-
// 将示例组件整合为一个对象导出
|
15
|
-
export const iPhoneWindowExamples = {
|
16
|
-
Basic,
|
17
|
-
WeatherApp,
|
18
|
-
NoFrame,
|
19
|
-
CustomBackground,
|
20
|
-
};
|
21
|
-
|
22
|
-
// 导出示例组件的源代码(简化版本)
|
23
|
-
export const iPhoneWindowExampleCodes = {
|
24
|
-
Basic: extractSimpleExample(BasicSource, 'iPhoneWindow'),
|
25
|
-
NoFrame: extractSimpleExample(NoFrameSource, 'iPhoneWindow'),
|
26
|
-
CustomBackground: extractSimpleExample(CustomBackgroundSource, 'iPhoneWindow'),
|
27
|
-
WeatherApp: extractSimpleExample(WeatherAppSource, 'iPhoneWindow'),
|
28
|
-
};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|