From 5da038138e5629359939679936e68a65a077daca Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 19 九月 2025 09:59:58 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
admin/src/components/common/Value.vue | 64 ++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/admin/src/components/common/Value.vue b/admin/src/components/common/Value.vue
new file mode 100644
index 0000000..41e8c7f
--- /dev/null
+++ b/admin/src/components/common/Value.vue
@@ -0,0 +1,64 @@
+<template>
+ <div class="value">
+ <i class="el-icon-loading" v-if="data == null"></i>
+ <slot v-else>{{getValue()}}{{suffix}}</slot>
+ </div>
+</template>
+
+<script>
+export default {
+ name: 'Value',
+ props: {
+ data: {
+ type: Object
+ },
+ prop: {
+ type: String
+ },
+ suffix: {
+ type: String
+ },
+ handler: {
+ type: Function
+ }
+ },
+ methods: {
+ /**
+ * 鑾峰彇鍊�
+ *
+ * @returns {string}
+ */
+ getValue () {
+ if (this.data == null) {
+ return ''
+ }
+ if (this.prop == null) {
+ return this.data
+ }
+ const props = this.prop.split('.')
+ let i = 0
+ let value = this.data
+ while (i < props.length) {
+ value = value[props[i]]
+ i++
+ }
+ if (this.handler == null) {
+ return value
+ }
+ return this.handler(value)
+ }
+ }
+}
+</script>
+
+<style scoped lang="scss">
+.value {
+ word-break: break-all;
+ .el-icon-loading {
+ font-size: 16px;
+ color: #999;
+ position: relative;
+ top: 1px;
+ }
+}
+</style>
--
Gitblit v1.9.3