easybill-ui 1.0.24 → 1.0.25
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.
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-tag
|
|
2
|
+
<div class="el-tag constant-status" :class="tagClass" v-bind="currentProps">
|
|
3
3
|
<el-icon v-if="(current.icon || current.iconClass) && !current.dot" :class="current.iconClass" style="margin-right: 5px">
|
|
4
4
|
<component :is="current.icon" v-if="current.icon" class="icon" :size="14" style="width: 12px; height: 12px" />
|
|
5
5
|
</el-icon>
|
|
6
6
|
<span v-if="current.dot" class="dot"></span>
|
|
7
7
|
<span v-if="current.html" class="name" v-html="current.label"></span>
|
|
8
8
|
<span v-else class="name">{{ current.label }}</span>
|
|
9
|
-
</
|
|
10
|
-
<span v-else>{{ typeof value === "undefined" || value === "" ? "--" : value }}</span>
|
|
9
|
+
</div>
|
|
11
10
|
</template>
|
|
12
11
|
<script lang="ts">
|
|
13
12
|
export default {
|
|
@@ -37,27 +36,33 @@ const current = computed(() => {
|
|
|
37
36
|
label: curs.map((a) => a.label).join(","),
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
return undefined
|
|
42
|
-
}
|
|
43
|
-
return result && result.find((a) => a.value == props.value)
|
|
39
|
+
return (result && result.find((a) => a.value == props.value)) || {}
|
|
44
40
|
})
|
|
45
41
|
const currentProps = computed(() => {
|
|
46
|
-
const defaults = { type: "", label: "", value: "",
|
|
42
|
+
const defaults = { type: "", label: "", value: "", style: {} } as OptionItem
|
|
47
43
|
const result = props.options || []
|
|
48
44
|
const cur = result.find((a) => a.value == props.value)
|
|
49
45
|
if (!cur) return {}
|
|
50
46
|
const { label, value, border, type, ...args } = cur
|
|
51
47
|
if (typeof border !== "undefined") {
|
|
52
|
-
defaults.class = ["no-border"]
|
|
53
48
|
defaults.style = args.color ? { color: args.color, backgroundColor: "transparent" } : {}
|
|
54
49
|
}
|
|
55
|
-
// 判断type在不在里面
|
|
56
|
-
if (type && ["success", "info", "warning", "danger"].includes(String(type))) {
|
|
57
|
-
defaults.type = type
|
|
58
|
-
} else {
|
|
59
|
-
defaults.class.push("el-tag--" + (type || "default"))
|
|
60
|
-
}
|
|
61
50
|
return { ...defaults, ...args }
|
|
62
51
|
})
|
|
52
|
+
const tagClass = computed(() => {
|
|
53
|
+
const result = [current.value?.dot ? "dot-status" : "", "el-tag--" + (current.value?.type || "default"), "el-tag--" + (current.value?.effect || "light")]
|
|
54
|
+
if (current.value?.size) {
|
|
55
|
+
result.push("el-tag--" + current.value?.size)
|
|
56
|
+
}
|
|
57
|
+
if (current.value?.hit) {
|
|
58
|
+
result.push("is-hit")
|
|
59
|
+
}
|
|
60
|
+
if (current.value?.round) {
|
|
61
|
+
result.push("is-round")
|
|
62
|
+
}
|
|
63
|
+
if (typeof current.value?.border !== "undefined") {
|
|
64
|
+
result.push("no-border")
|
|
65
|
+
}
|
|
66
|
+
return result
|
|
67
|
+
})
|
|
63
68
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easybill-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "A component library for easybill",
|
|
5
5
|
"author": "tuchongyang <779311998@qq.com>",
|
|
6
6
|
"private": false,
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"publishConfig": {
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "028e472c4918af43e28512f928ff9823526afe90"
|
|
18
18
|
}
|