| | |
| | | typeof dataTypeFn(scope.row[item.prop], item.formatData) === |
| | | 'string' |
| | | " |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :title="formatters(scope.row[item.prop], item.formatData, scope.row)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | {{ formatters(scope.row[item.prop], item.formatData, scope.row) }} |
| | | </el-tag> |
| | | <el-tag v-for="(tag, index) in dataTypeFn( |
| | | scope.row[item.prop], |
| | |
| | | 'object' |
| | | " |
| | | :key="index" |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :title="formatters(scope.row[item.prop], item.formatData, scope.row)" |
| | | :type="formatType(tag, item.formatType)"> |
| | | {{ item.tagGroup ? tag[item.tagGroup.label] ?? tag : tag }} |
| | | </el-tag> |
| | | <el-tag v-else |
| | | :title="formatters(scope.row[item.prop], item.formatData)" |
| | | :title="formatters(scope.row[item.prop], item.formatData, scope.row)" |
| | | :type="formatType(scope.row[item.prop], item.formatType)"> |
| | | {{ formatters(scope.row[item.prop], item.formatData) }} |
| | | {{ formatters(scope.row[item.prop], item.formatData, scope.row) }} |
| | | </el-tag> |
| | | </div> |
| | | <!-- 按钮 --> |
| | |
| | | style="width: 100%"> |
| | | <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span> |
| | | <span v-else>{{ |
| | | formatters(scope.row[item.prop], item.formatData) |
| | | formatters(scope.row[item.prop], item.formatData, scope.row) |
| | | }}</span> |
| | | </div> |
| | | </template> |
| | |
| | | return typeof val === "function" ? val(row) : val; |
| | | }; |
| | | |
| | | const formatters = (val, format) => { |
| | | return typeof format === "function" ? format(val) : val; |
| | | const formatters = (val, format, row) => { |
| | | return typeof format === "function" ? format(val, row) : val; |
| | | }; |
| | | |
| | | // Props(使用 defineProps 的非 TS 形式) |