vuv-ui 1.0.6 → 1.0.8
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/package.json +15 -9
- package/src/App.vue +23 -0
- package/src/components/button/Data.vue +205 -0
- package/src/components/button/View.vue +50 -0
- package/src/components/button/index.ts +41 -0
- package/src/components/collapse/Data.vue +169 -0
- package/src/components/collapse/View.vue +37 -0
- package/src/components/collapse/index.ts +34 -0
- package/src/components/index.ts +14 -0
- package/src/components/numberBxo/Data.vue +98 -0
- package/src/components/numberBxo/View.vue +40 -0
- package/src/components/numberBxo/index.ts +40 -0
- package/src/components/textarea/Data.vue +148 -0
- package/src/components/textarea/View.vue +36 -0
- package/src/components/textarea/index.ts +31 -0
- package/src/main.ts +7 -0
- package/vuv-ui/src/components/button/Data.vue.d.ts +5 -6
- package/vuv-ui/src/components/button/View.vue.d.ts +5 -6
- package/vuv-ui/src/components/button/index.d.ts +8 -8
- package/vuv-ui/src/components/collapse/Data.vue.d.ts +5 -6
- package/vuv-ui/src/components/collapse/View.vue.d.ts +5 -6
- package/vuv-ui/src/components/collapse/index.d.ts +8 -8
- package/vuv-ui/src/components/index.d.ts +445 -1
- package/vuv-ui/src/components/numberBxo/Data.vue.d.ts +5 -6
- package/vuv-ui/src/components/numberBxo/View.vue.d.ts +5 -6
- package/vuv-ui/src/components/numberBxo/index.d.ts +8 -8
- package/vuv-ui/src/components/textarea/Data.vue.d.ts +5 -6
- package/vuv-ui/src/components/textarea/View.vue.d.ts +5 -6
- package/vuv-ui/src/components/textarea/index.d.ts +8 -8
- package/vuv-ui/src/main.d.ts +1 -0
- package/vuv-ui/style.css +1 -0
- package/vuv-ui/vuv-ui.es.js +1214 -8604
- package/vuv-ui/vuv-ui.umd.js +1 -1
- package/vuv-ui/src/App.vue.d.ts +0 -3
- package/vuv-ui/vuv-ui.css +0 -2
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuv-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.8",
|
|
5
5
|
"description": "基于UVUI 组件再次封装",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "lsq",
|
|
8
8
|
"files": [
|
|
9
9
|
"vuv-ui",
|
|
10
|
-
"vuv-ui/**"
|
|
10
|
+
"vuv-ui/**",
|
|
11
|
+
"src",
|
|
12
|
+
"src/**"
|
|
11
13
|
],
|
|
12
14
|
"scripts": {
|
|
13
15
|
"dev": "vite",
|
|
@@ -19,30 +21,34 @@
|
|
|
19
21
|
},
|
|
20
22
|
"exports": {
|
|
21
23
|
".": {
|
|
22
|
-
"import": "./
|
|
24
|
+
"import": "./src/components/index.ts",
|
|
23
25
|
"require": "./vuv-ui/vuv-ui.umd.js",
|
|
24
26
|
"types": "./vuv-ui/src/components/index.d.ts"
|
|
25
27
|
},
|
|
26
28
|
"./style.css": "./vuv-ui/style.css"
|
|
27
29
|
},
|
|
28
30
|
"peerDependencies": {
|
|
29
|
-
"vue": ">=3.2.0",
|
|
30
31
|
"element-plus": ">=2.2.0",
|
|
31
|
-
"uv-ui": ">=1.0.0"
|
|
32
|
+
"uv-ui": ">=1.0.0",
|
|
33
|
+
"vue": ">=3.2.0"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
36
|
"@tsconfig/node24": "^24.0.4",
|
|
35
37
|
"@types/node": "^24.12.2",
|
|
36
|
-
"@vitejs/plugin-vue": "
|
|
38
|
+
"@vitejs/plugin-vue": "4.0.0",
|
|
39
|
+
"@vue/compiler-sfc": "3.2.45",
|
|
37
40
|
"@vue/tsconfig": "^0.9.1",
|
|
38
41
|
"npm-run-all2": "^8.0.4",
|
|
39
42
|
"prettier": "3.8.3",
|
|
43
|
+
"sass": "^1.100.0",
|
|
40
44
|
"sass-embedded": "^1.100.0",
|
|
41
45
|
"typescript": "~6.0.0",
|
|
42
|
-
"
|
|
43
|
-
"vite
|
|
46
|
+
"unplugin-vue-setup-extend-plus": "^1.0.1",
|
|
47
|
+
"vite": "^4.0.0",
|
|
48
|
+
"vite-plugin-dts": "^3.0.0",
|
|
44
49
|
"vite-plugin-vue-devtools": "^8.1.1",
|
|
45
|
-
"vue
|
|
50
|
+
"vue": "3.2.45",
|
|
51
|
+
"vue-tsc": "^1.0.0"
|
|
46
52
|
},
|
|
47
53
|
"main": "./vuv-ui/vuv-ui.umd.js",
|
|
48
54
|
"module": "./vuv-ui/vuv-ui.es.js",
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<h1>You did it!</h1>
|
|
4
|
+
<p>
|
|
5
|
+
Visit
|
|
6
|
+
<a href="https://vuejs.org/" target="_blank" rel="noopener">vuejs.org</a>
|
|
7
|
+
to read the documentation
|
|
8
|
+
</p>
|
|
9
|
+
<uv-button>默认按钮</uv-button>
|
|
10
|
+
<el-switch v-model="hairline"></el-switch>
|
|
11
|
+
|
|
12
|
+
<Data></Data>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
<script setup lang="ts">
|
|
16
|
+
import uvButton from './components/button/View.vue';
|
|
17
|
+
import Data from './components/button/Data.vue';
|
|
18
|
+
// import { uvButton } from 'uv-ui';
|
|
19
|
+
import { ref } from 'vue';
|
|
20
|
+
const hairline = ref(true);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<style scoped></style>
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="banner-content" v-if="isShow">
|
|
3
|
+
<el-form label-width="100px">
|
|
4
|
+
<el-form-item label="显示边框">
|
|
5
|
+
<el-switch v-model="options.hairline"></el-switch>
|
|
6
|
+
</el-form-item>
|
|
7
|
+
<el-form-item label="宽度">
|
|
8
|
+
<el-input-number v-model="options.width"></el-input-number>
|
|
9
|
+
</el-form-item>
|
|
10
|
+
<el-form-item label="高度">
|
|
11
|
+
<el-input-number v-model="options.height"></el-input-number>
|
|
12
|
+
</el-form-item>
|
|
13
|
+
<el-form-item label="主题颜色">
|
|
14
|
+
<el-select v-model="options.type" placeholder="请选择" style="width: 180px">
|
|
15
|
+
<el-option label="primary" value="primary" />
|
|
16
|
+
<el-option label="success" value="success" />
|
|
17
|
+
<el-option label="info" value="info" />
|
|
18
|
+
<el-option label="warning" value="warning" />
|
|
19
|
+
<el-option label="error" value="error" />
|
|
20
|
+
</el-select>
|
|
21
|
+
</el-form-item>
|
|
22
|
+
<el-form-item label="大小">
|
|
23
|
+
<el-radio-group v-model="options.size">
|
|
24
|
+
<el-radio-button label="normal">normal</el-radio-button>
|
|
25
|
+
<el-radio-button label="medium">medium</el-radio-button>
|
|
26
|
+
<el-radio-button label="mini">mini</el-radio-button>
|
|
27
|
+
</el-radio-group>
|
|
28
|
+
</el-form-item>
|
|
29
|
+
<el-form-item label="按钮位置">
|
|
30
|
+
<el-radio-group v-model="options.position">
|
|
31
|
+
<el-radio-button label="left">居左</el-radio-button>
|
|
32
|
+
<el-radio-button label="center">居中</el-radio-button>
|
|
33
|
+
<el-radio-button label="right">居右</el-radio-button>
|
|
34
|
+
</el-radio-group>
|
|
35
|
+
</el-form-item>
|
|
36
|
+
<el-form-item label="形状">
|
|
37
|
+
<el-radio-group v-model="options.shape">
|
|
38
|
+
<el-radio-button label="square">square</el-radio-button>
|
|
39
|
+
<el-radio-button label="circle">circle</el-radio-button>
|
|
40
|
+
</el-radio-group>
|
|
41
|
+
</el-form-item>
|
|
42
|
+
<el-form-item label="镂空">
|
|
43
|
+
<el-switch v-model="options.plain"></el-switch>
|
|
44
|
+
</el-form-item>
|
|
45
|
+
<el-form-item label="禁用">
|
|
46
|
+
<el-switch v-model="options.disabled"></el-switch>
|
|
47
|
+
</el-form-item>
|
|
48
|
+
<el-form-item label="铺满">
|
|
49
|
+
<el-switch v-model="options.fill"></el-switch>
|
|
50
|
+
</el-form-item>
|
|
51
|
+
<el-form-item label="loading图标">
|
|
52
|
+
<el-switch v-model="options.loading"></el-switch>
|
|
53
|
+
</el-form-item>
|
|
54
|
+
<el-form-item label="加载中文字">
|
|
55
|
+
<el-input v-model="options.loadingText" style="width: 180px" placeholder="请输入" clearable />
|
|
56
|
+
</el-form-item>
|
|
57
|
+
|
|
58
|
+
<el-form-item label="开放能力">
|
|
59
|
+
<el-select v-model="options.openType" placeholder="请选择" style="width: 180px" clearable>
|
|
60
|
+
<el-option label="跳转页面" value="navigateTo" />
|
|
61
|
+
<el-option label="获取用户信息" value="getUserInfo" />
|
|
62
|
+
<el-option label="联系客服" value="contact" />
|
|
63
|
+
<el-option label="获取手机号" value="getPhoneNumber" />
|
|
64
|
+
<el-option label="打开授权设置" value="openSetting" />
|
|
65
|
+
<el-option label="获取用户头像" value="chooseAvatar" />
|
|
66
|
+
<el-option label="意见反馈" value="feedback" />
|
|
67
|
+
<el-option label="分享" value="share" />
|
|
68
|
+
<el-option label="自定义" value="customize" />
|
|
69
|
+
</el-select>
|
|
70
|
+
</el-form-item>
|
|
71
|
+
|
|
72
|
+
<!-- 页面路径 -->
|
|
73
|
+
<el-form-item label="页面路径" v-if="options.openType == 'navigateTo'">
|
|
74
|
+
<el-input v-model="options.pagePath" style="width: 180px" placeholder="请输入" clearable />
|
|
75
|
+
</el-form-item>
|
|
76
|
+
<!-- 是否tabbar页面 -->
|
|
77
|
+
<el-form-item label="tabbar页面" v-if="options.openType == 'navigateTo'">
|
|
78
|
+
<el-switch v-model="options.isTabBar"></el-switch>
|
|
79
|
+
</el-form-item>
|
|
80
|
+
|
|
81
|
+
<el-form-item label="按钮文字">
|
|
82
|
+
<el-input v-model="options.text" style="width: 180px" placeholder="请输入" clearable />
|
|
83
|
+
</el-form-item>
|
|
84
|
+
<!-- <el-form-item label="按钮图标">
|
|
85
|
+
<el-input v-model="options.icon" style="width: 180px" placeholder="请输入" clearable />
|
|
86
|
+
</el-form-item> -->
|
|
87
|
+
<el-form-item label="按钮颜色">
|
|
88
|
+
<el-color-picker v-model="options.color" show-alpha />
|
|
89
|
+
</el-form-item>
|
|
90
|
+
<el-form-item label="文字颜色">
|
|
91
|
+
<el-color-picker v-model="options.textColor" show-alpha />
|
|
92
|
+
</el-form-item>
|
|
93
|
+
<el-form-item label="自定义样式">
|
|
94
|
+
<el-input v-model="options.customStyle" style="width: 240px" placeholder="分号分隔,如width: 100px;height: 50px;" type="textarea" clearable />
|
|
95
|
+
</el-form-item>
|
|
96
|
+
</el-form>
|
|
97
|
+
</div>
|
|
98
|
+
</template>
|
|
99
|
+
|
|
100
|
+
<script setup lang="ts" name="ButtonData">
|
|
101
|
+
import { ref, onMounted } from 'vue';
|
|
102
|
+
const props = defineProps({
|
|
103
|
+
data: {
|
|
104
|
+
type: Object,
|
|
105
|
+
default: () => {}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const options = ref();
|
|
110
|
+
const data = ref();
|
|
111
|
+
const isShow = ref(false);
|
|
112
|
+
|
|
113
|
+
onMounted(() => {
|
|
114
|
+
console.log(props.data, props, '参数接收');
|
|
115
|
+
if (props.data) {
|
|
116
|
+
data.value = props.data.data;
|
|
117
|
+
options.value = props.data.options;
|
|
118
|
+
isShow.value = true;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<style lang="scss" scoped>
|
|
124
|
+
.banner-content {
|
|
125
|
+
overflow-x: auto;
|
|
126
|
+
}
|
|
127
|
+
.item-list {
|
|
128
|
+
display: flex;
|
|
129
|
+
justify-content: space-between;
|
|
130
|
+
margin: 10px;
|
|
131
|
+
border: 1px solid #c8c8c8;
|
|
132
|
+
border-radius: 4px;
|
|
133
|
+
padding: 5px;
|
|
134
|
+
|
|
135
|
+
.l-info {
|
|
136
|
+
font-size: 12px;
|
|
137
|
+
padding-top: 4px;
|
|
138
|
+
width: calc(100% - 100px);
|
|
139
|
+
|
|
140
|
+
p {
|
|
141
|
+
margin: 5px 0 0;
|
|
142
|
+
white-space: nowrap;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
display: flex;
|
|
145
|
+
|
|
146
|
+
.link {
|
|
147
|
+
color: #1b8bff;
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.text {
|
|
152
|
+
white-space: nowrap;
|
|
153
|
+
text-align: -webkit-auto;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.r-image {
|
|
161
|
+
text-align: right;
|
|
162
|
+
|
|
163
|
+
.el-icon-close {
|
|
164
|
+
color: #999;
|
|
165
|
+
font-size: 12px;
|
|
166
|
+
font-weight: 600;
|
|
167
|
+
margin-bottom: 6px;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
|
|
170
|
+
&:hover {
|
|
171
|
+
color: red;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.image-box {
|
|
176
|
+
width: 100px;
|
|
177
|
+
height: 70px;
|
|
178
|
+
border-radius: 5px;
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
position: relative;
|
|
181
|
+
background: #fff;
|
|
182
|
+
display: flex;
|
|
183
|
+
justify-content: center;
|
|
184
|
+
align-items: center;
|
|
185
|
+
|
|
186
|
+
img {
|
|
187
|
+
max-width: 100%;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.placeholder-text {
|
|
191
|
+
color: #999;
|
|
192
|
+
font-size: 12px;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.mt-5px {
|
|
199
|
+
margin-top: 5px;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.mt-10px {
|
|
203
|
+
margin-top: 10px;
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="button_box" v-if="data && data.options" :class="{ plain: data.options.plain }" :style="{ 'justify-content': data.options.position }">
|
|
3
|
+
<uv-button
|
|
4
|
+
:type="data.options.type || 'primary'"
|
|
5
|
+
:bgColor="data.options.color"
|
|
6
|
+
:disabled="data.options.disabled"
|
|
7
|
+
:color="data.options.textColor"
|
|
8
|
+
:round="data.options.shape == 'circle' ? true : false"
|
|
9
|
+
:square="data.options.shape == 'square' ? true : false"
|
|
10
|
+
:size="data.options.size"
|
|
11
|
+
:loading="data.options.loading"
|
|
12
|
+
:icon="data.options.icon"
|
|
13
|
+
:style="{
|
|
14
|
+
width: data.options.width + 'px',
|
|
15
|
+
height: data.options.height + 'px'
|
|
16
|
+
}"
|
|
17
|
+
>
|
|
18
|
+
{{ data.options.text || '按钮' }}
|
|
19
|
+
</uv-button>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script setup lang="ts" name="ButtonView">
|
|
24
|
+
import { uvButton } from 'uv-ui';
|
|
25
|
+
const props = defineProps({
|
|
26
|
+
data: {
|
|
27
|
+
type: Object,
|
|
28
|
+
default: () => {}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style lang="scss" scoped>
|
|
34
|
+
// 提取data.options.customStyle 样式
|
|
35
|
+
|
|
36
|
+
.button_box {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
margin-top: 10px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.button_box:deep(.uv-button) {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.plain:deep(.uv-button) {
|
|
48
|
+
background-color: transparent !important;
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import ButtonView from './View.vue';
|
|
2
|
+
import ButtonData from './Data.vue';
|
|
3
|
+
|
|
4
|
+
const buttonTypeList = {
|
|
5
|
+
type: 'uvui-button',
|
|
6
|
+
name: '按钮',
|
|
7
|
+
icon: 'Postcard',
|
|
8
|
+
fontIcon: 'icon-shangpinanniu_changtiaoanniu',
|
|
9
|
+
page: 'index,activity',
|
|
10
|
+
viewCom: ButtonView,
|
|
11
|
+
editCom: ButtonData,
|
|
12
|
+
limit: 0
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const buttonOptions = {
|
|
16
|
+
data: {},
|
|
17
|
+
options: {
|
|
18
|
+
width: '100', //宽度
|
|
19
|
+
height: '45', //高度
|
|
20
|
+
hairline: true, //是否显示边框
|
|
21
|
+
type: 'primary', //主题颜色
|
|
22
|
+
size: 'normal', //大小
|
|
23
|
+
shape: 'square', //形状
|
|
24
|
+
position: 'left', //按钮位置
|
|
25
|
+
plain: false, //镂空
|
|
26
|
+
disabled: false, //禁用
|
|
27
|
+
loading: false, //loading图标
|
|
28
|
+
loadingText: '', //加载中文字
|
|
29
|
+
openType: 'navigateTo', //开放能力
|
|
30
|
+
pagePath: '', //页面路径
|
|
31
|
+
isTabBar: false, //是否tabbar页面
|
|
32
|
+
text: '', //按钮文字
|
|
33
|
+
textColor: '#ffffff', //按钮文字颜色
|
|
34
|
+
icon: '', //按钮图标
|
|
35
|
+
color: '', //按钮颜色
|
|
36
|
+
customStyle: '', //自定义样式
|
|
37
|
+
fill: true //组件是否铺满父容器
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { buttonTypeList, buttonOptions };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="banner-content" v-if="isShow">
|
|
3
|
+
<el-form label-width="100px">
|
|
4
|
+
<el-form-item label="是否铺满">
|
|
5
|
+
<el-switch v-model="options.fill"></el-switch>
|
|
6
|
+
</el-form-item>
|
|
7
|
+
</el-form>
|
|
8
|
+
|
|
9
|
+
<el-button type="primary" @click="addItem" class="mt-10px">添加项</el-button>
|
|
10
|
+
<div class="item-list" v-for="(item, index) in data.list" :key="index">
|
|
11
|
+
<div class="l-info">
|
|
12
|
+
<div class="mt-5px">
|
|
13
|
+
<span>标题:</span>
|
|
14
|
+
<el-input v-model="item.title" style="width: 180px" placeholder="请输入" clearable />
|
|
15
|
+
</div>
|
|
16
|
+
<div class="mt-5px">
|
|
17
|
+
<span>内容:</span>
|
|
18
|
+
<el-input v-model="item.value" style="width: 180px" placeholder="请输入" clearable />
|
|
19
|
+
</div>
|
|
20
|
+
<div class="mt-5px">
|
|
21
|
+
<span>描述:</span>
|
|
22
|
+
<el-input v-model="item.label" style="width: 180px" placeholder="请输入" clearable />
|
|
23
|
+
</div>
|
|
24
|
+
<div class="mt-5px">
|
|
25
|
+
<span>禁用:</span>
|
|
26
|
+
<el-switch v-model="item.disabled"></el-switch>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="mt-5px">
|
|
29
|
+
<span>右箭头:</span>
|
|
30
|
+
<el-switch v-model="item.isLink"></el-switch>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="mt-5px">
|
|
33
|
+
<span>点击反馈:</span>
|
|
34
|
+
<el-switch v-model="item.clickable"></el-switch>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="mt-5px">
|
|
37
|
+
<span>显示内边框:</span>
|
|
38
|
+
<el-switch v-model="item.border"></el-switch>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="mt-5px">
|
|
41
|
+
<el-button type="danger" @click="removeItem(index)" size="small">删除</el-button>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script setup lang="ts" name="CollapseData">
|
|
49
|
+
import { ref, onMounted } from 'vue';
|
|
50
|
+
|
|
51
|
+
const props = defineProps({
|
|
52
|
+
data: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => {}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const options = ref();
|
|
59
|
+
const data = ref();
|
|
60
|
+
const isShow = ref(false);
|
|
61
|
+
|
|
62
|
+
const removeItem = (index: number | string) => {
|
|
63
|
+
data.value.list.splice(index, 1);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const addItem = () => {
|
|
67
|
+
data.value.list.push({
|
|
68
|
+
title: '面板标题', // 面板标题
|
|
69
|
+
value: '右侧内容', //标题右侧内容
|
|
70
|
+
label: '', //标题下方的描述信息
|
|
71
|
+
disabled: false, //是否禁止面板的展开和收起
|
|
72
|
+
isLink: true, //是否展示右侧箭头并开启点击反馈
|
|
73
|
+
clickable: true, //是否开启点击反馈
|
|
74
|
+
border: true //是否显示内边框
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
onMounted(() => {
|
|
79
|
+
if (props.data) {
|
|
80
|
+
data.value = props.data.data;
|
|
81
|
+
options.value = props.data.options;
|
|
82
|
+
isShow.value = true;
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="scss" scoped>
|
|
88
|
+
.banner-content {
|
|
89
|
+
overflow-x: auto;
|
|
90
|
+
}
|
|
91
|
+
.item-list {
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
margin: 10px;
|
|
95
|
+
border: 1px solid #c8c8c8;
|
|
96
|
+
border-radius: 4px;
|
|
97
|
+
padding: 5px;
|
|
98
|
+
|
|
99
|
+
.l-info {
|
|
100
|
+
font-size: 12px;
|
|
101
|
+
padding-top: 4px;
|
|
102
|
+
width: calc(100% - 100px);
|
|
103
|
+
|
|
104
|
+
p {
|
|
105
|
+
margin: 5px 0 0;
|
|
106
|
+
white-space: nowrap;
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
display: flex;
|
|
109
|
+
|
|
110
|
+
.link {
|
|
111
|
+
color: #1b8bff;
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.text {
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
text-align: -webkit-auto;
|
|
118
|
+
text-overflow: ellipsis;
|
|
119
|
+
overflow: hidden;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.r-image {
|
|
125
|
+
text-align: right;
|
|
126
|
+
|
|
127
|
+
.el-icon-close {
|
|
128
|
+
color: #999;
|
|
129
|
+
font-size: 12px;
|
|
130
|
+
font-weight: 600;
|
|
131
|
+
margin-bottom: 6px;
|
|
132
|
+
cursor: pointer;
|
|
133
|
+
|
|
134
|
+
&:hover {
|
|
135
|
+
color: red;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.image-box {
|
|
140
|
+
width: 100px;
|
|
141
|
+
height: 70px;
|
|
142
|
+
border-radius: 5px;
|
|
143
|
+
overflow: hidden;
|
|
144
|
+
position: relative;
|
|
145
|
+
background: #fff;
|
|
146
|
+
display: flex;
|
|
147
|
+
justify-content: center;
|
|
148
|
+
align-items: center;
|
|
149
|
+
|
|
150
|
+
img {
|
|
151
|
+
max-width: 100%;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.placeholder-text {
|
|
155
|
+
color: #999;
|
|
156
|
+
font-size: 12px;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.mt-5px {
|
|
163
|
+
margin-top: 5px;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.mt-10px {
|
|
167
|
+
margin-top: 10px;
|
|
168
|
+
}
|
|
169
|
+
</style>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cell_box" v-if="data && data.options">
|
|
3
|
+
<uv-collapse v-model="list">
|
|
4
|
+
<uv-collapse-item v-for="(item, index) in collapseList" :key="index" :name="item.title + '_' + index">
|
|
5
|
+
<template #title>{{ item.title }}</template>
|
|
6
|
+
<template #right>{{ item.value }}</template>
|
|
7
|
+
{{ item.label }}
|
|
8
|
+
</uv-collapse-item>
|
|
9
|
+
</uv-collapse>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script setup lang="ts" name="CollapseView">
|
|
14
|
+
import { ref, computed } from 'vue';
|
|
15
|
+
import { uvCollapse, uvCollapseItem } from 'uv-ui';
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
data: {
|
|
18
|
+
type: Object,
|
|
19
|
+
default: () => {}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const list = ref([]);
|
|
24
|
+
|
|
25
|
+
const collapseList = computed(() => {
|
|
26
|
+
if (props.data.data && props.data.data.list) {
|
|
27
|
+
list.value = props.data.data.list.map((item: any, index: number) => item.title + '_' + index);
|
|
28
|
+
return props.data.data.list;
|
|
29
|
+
}
|
|
30
|
+
return [];
|
|
31
|
+
});
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style lang="scss" scoped>
|
|
35
|
+
.cell_box {
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import CollapseView from './View.vue';
|
|
2
|
+
import CollapseData from './Data.vue';
|
|
3
|
+
|
|
4
|
+
const collapseTypeList = {
|
|
5
|
+
type: 'uvui-collapse',
|
|
6
|
+
name: '折叠面板',
|
|
7
|
+
icon: 'Postcard',
|
|
8
|
+
fontIcon: 'icon-danyuange1',
|
|
9
|
+
page: 'index,activity',
|
|
10
|
+
viewCom: CollapseView,
|
|
11
|
+
editCom: CollapseData,
|
|
12
|
+
limit: 0
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const collapseOptions = {
|
|
16
|
+
data: {
|
|
17
|
+
list: [
|
|
18
|
+
{
|
|
19
|
+
title: '面板标题', // 面板标题
|
|
20
|
+
value: '右侧内容', //标题右侧内容
|
|
21
|
+
label: '', //标题下方的描述信息
|
|
22
|
+
disabled: false, //是否禁止面板的展开和收起
|
|
23
|
+
isLink: true, //是否展示右侧箭头并开启点击反馈
|
|
24
|
+
clickable: true, //是否开启点击反馈
|
|
25
|
+
border: true //是否显示内边框
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
options: {
|
|
30
|
+
fill: false //组件是否铺满父容器
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { collapseTypeList, collapseOptions };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { buttonTypeList, buttonOptions } from './button/index';
|
|
2
|
+
import { textareaTypeList, textareaOptions } from './textarea/index';
|
|
3
|
+
import { numberBoxTypeList, numberBoxOptions } from './numberBxo/index';
|
|
4
|
+
import { collapseTypeList, collapseOptions } from './collapse/index';
|
|
5
|
+
|
|
6
|
+
export const uvUiList = { buttonTypeList, textareaTypeList, numberBoxTypeList, collapseTypeList };
|
|
7
|
+
export const uvUIOptions = { buttonOptions, textareaOptions, numberBoxOptions, collapseOptions };
|
|
8
|
+
|
|
9
|
+
const hsryvvuUI = {
|
|
10
|
+
uvUiList,
|
|
11
|
+
uvUIOptions
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default hsryvvuUI;
|