cbvirtua 1.0.5 → 1.0.7

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.
@@ -0,0 +1,74 @@
1
+ <template>
2
+ <li class="wzc_option" :style="styleVar" @click="currentSelect">
3
+ <div class="wzc_option_dropdown_item">{{ label }}</div>
4
+ </li>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: "wzc_select",
10
+ components: {},
11
+ props: {
12
+ width: {
13
+ type: Number,
14
+ default: -1,
15
+ },
16
+ height: {
17
+ type: Number,
18
+ default: 34,
19
+ },
20
+ label: {
21
+ type: String,
22
+ },
23
+ optionid: {
24
+ type: String,
25
+ },
26
+ },
27
+ data() {
28
+ return {};
29
+ },
30
+ created() {},
31
+ mounted() {},
32
+ watch: {},
33
+ computed: {
34
+ styleVar() {
35
+ return {
36
+ "--option-height": this.height + "px",
37
+ "--option-width": this.width == -1? "100%" : this.width + "px",
38
+ };
39
+ },
40
+ },
41
+ methods: {
42
+ currentSelect() {
43
+ this.$parent.label = this.label;
44
+ this.$parent.optionid = this.optionid;
45
+ this.$parent.isListShow = !this.$parent.isListShow;
46
+ // this.$emit('slot-content', {label: this.label, optionid: this.optionid} );
47
+ }
48
+ },
49
+ };
50
+ </script>
51
+ <style scoped>
52
+ .wzc_option {
53
+ list-style: none;
54
+ height: var(--option-height);
55
+ width: var(--option-width);
56
+
57
+ }
58
+ .wzc_option:hover {
59
+ color: #409eff;
60
+ font-weight: 700;
61
+ background-color: #f5f7fa;
62
+ }
63
+ .wzc_option_dropdown_item {
64
+ height: 100%;
65
+ width: calc(100% - 30px);
66
+ line-height: var(--option-height);
67
+ cursor: pointer;
68
+ margin: 0 auto;
69
+ overflow: hidden;
70
+ text-overflow: ellipsis;
71
+ white-space: nowrap;
72
+ }
73
+
74
+ </style>
@@ -0,0 +1,209 @@
1
+ <template>
2
+ <div class="wzc_select" :style="styleVar">
3
+ <div class="divSelect" :class="{ 'drop_down': isListShow }" ref="divSelect">
4
+ <div class="divSelectinput" @click="dropDownSelect">
5
+ <!-- 选中后的内容 -->
6
+ <div class="selectinfos" :title="label" :class="{ 'no_select': label == '请选择' }"> {{ label }} </div>
7
+ <!-- 三角形图标 -->
8
+ <i class="imgthree" :class="{ 'is-reverse': isListShow }">
9
+ <svg t="1707138975702" class="icon" viewBox="0 0 1024 1024" version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg" p-id="1444" width="16" height="16">
11
+ <path d="M512 187.24L699.501 512 887 836.76H137L324.5 512z" p-id="1445"></path>
12
+ </svg>
13
+ </i>
14
+ </div>
15
+ </div>
16
+ <!-- 下拉框列表 -->
17
+ <transition name="drop-down">
18
+ <div class="Selectlist" v-show="isListShow" ref="dropDown">
19
+ <div class="select_triangle"></div>
20
+ <ul class="wzc_option_list">
21
+ <slot name="wzc_option"></slot>
22
+ </ul>
23
+ </div>
24
+ </transition>
25
+ </div>
26
+ </template>
27
+
28
+ <script>
29
+ export default {
30
+ name: 'wzc_select',
31
+ components: {},
32
+ props: {
33
+ placeholder: {
34
+ type: String,
35
+ default: '请选择'
36
+ },
37
+ width: {
38
+ type: Number,
39
+ default: 180
40
+ },
41
+ height: {
42
+ type: Number,
43
+ default: 40
44
+ },
45
+ },
46
+ data() {
47
+ return {
48
+ label: '',
49
+ isListShow: false,
50
+ optionid: ''
51
+ };
52
+ },
53
+ created() {
54
+ this.label = this.placeholder;
55
+ },
56
+ mounted() {
57
+ let _this = this;
58
+ document.addEventListener("click", function (e) {
59
+ if (_this.$refs.divSelect) {
60
+ if (!!_this.$refs.divSelect.contains(e.target) || !!_this.$refs.dropDown.contains(e.target))
61
+ return;
62
+ else
63
+ _this.isListShow = false;
64
+ }
65
+ })
66
+ },
67
+ computed: {
68
+ styleVar() {
69
+ return {
70
+ '--select-height': this.height + 'px',
71
+ '--select-width': this.width + 'px'
72
+ }
73
+ }
74
+ },
75
+ methods: {
76
+ dropDownSelect() {
77
+ this.isListShow = !this.isListShow;
78
+ },
79
+ },
80
+ };
81
+ </script>
82
+ <style scoped>
83
+ .wzc_select {
84
+ border: 1px solid #E6E6E6;
85
+ border-radius: 5px;
86
+ height: var(--select-height);
87
+ width: var(--select-width);
88
+ line-height: var(--select-height);
89
+ }
90
+
91
+ .divSelect {
92
+ width: 100%;
93
+ height: 100%;
94
+ border-radius: 5px;
95
+ }
96
+
97
+ .drop_down {
98
+ box-shadow: 0px 0px 6px #709DF7;
99
+ }
100
+
101
+ .divSelectinput {
102
+ width: calc(100% - 20px);
103
+ height: 100%;
104
+ margin: 0 5px 0 15px;
105
+ display: flex;
106
+ }
107
+
108
+ .selectinfos {
109
+ width: 87.5%;
110
+ cursor: pointer;
111
+ overflow: hidden;
112
+ text-overflow: ellipsis;
113
+ white-space: nowrap;
114
+ }
115
+
116
+ .no_select {
117
+ color: #D3DCE6;
118
+ }
119
+
120
+ .imgthree {
121
+ width: 12.5%;
122
+ line-height: var(--select-height);
123
+ text-align: center;
124
+ transform: rotate(180deg);
125
+ transition: all 0.3s;
126
+ }
127
+
128
+ .imgthree svg {
129
+ width: 1em;
130
+ height: 1em;
131
+ }
132
+
133
+ .imgthree:before {
134
+ cursor: pointer;
135
+ color: #D3DCE6;
136
+ }
137
+
138
+ .imgthree.is-reverse {
139
+ transform: rotate(0deg);
140
+ }
141
+
142
+ .Selectlist {
143
+ margin-top: 10px;
144
+ z-index: 800;
145
+ position: relative;
146
+ background-color: #fff;
147
+ }
148
+
149
+ .wzc_option_list {
150
+ border-radius: 5px;
151
+ border: 1px solid #E4E7ED;
152
+ width: 100%;
153
+ padding: 3px 0px;
154
+ box-shadow: 0px 0px 6px #709DF7;
155
+ background-color: #fff;
156
+ margin: 0;
157
+ }
158
+
159
+ .select_triangle {
160
+ width: 14px;
161
+ height: 7px;
162
+ position: relative;
163
+ left: 15px;
164
+ }
165
+
166
+ .select_triangle::before {
167
+ position: absolute;
168
+ content: "";
169
+ left: 0px;
170
+ width: 0;
171
+ height: 0;
172
+ border-top: 0px solid transparent;
173
+ border-left: 9px solid transparent;
174
+ border-right: 9px solid transparent;
175
+ border-bottom: 8px solid #EBEEF5;
176
+ }
177
+
178
+ .select_triangle::after {
179
+ position: absolute;
180
+ left: 2px;
181
+ top: 2px;
182
+ content: "";
183
+ width: 0;
184
+ height: 0;
185
+ border-top: 0px solid transparent;
186
+ border-left: 7px solid transparent;
187
+ border-right: 7px solid transparent;
188
+ border-bottom: 8px solid #fff;
189
+ }
190
+
191
+ .drop-down-enter {
192
+ opacity: 0;
193
+ transform: translate(0px, -80px) scaleY(0.2);
194
+ }
195
+
196
+ .drop-down-leave-to {
197
+ opacity: 0;
198
+ transform: translate(0px, -80px) scaleY(0.2);
199
+ }
200
+
201
+ .drop-down-enter-active {
202
+ transition: all 0.5s ease-in;
203
+ }
204
+
205
+ .drop-down-leave-active {
206
+ transition: all 0.5s ease;
207
+ }
208
+ </style>
209
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cbvirtua",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {