car_web/node_modules/.cache/vue-loader/52f7d64f6c6010d1260f78a2205...

1 line
3.9 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"remainingRequest":"D:\\workspace\\car_web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\workspace\\car_web\\src\\components\\DictTag\\index.vue?vue&type=style&index=0&id=7e7e1b87&scoped=true&lang=css","dependencies":[{"path":"D:\\workspace\\car_web\\src\\components\\DictTag\\index.vue","mtime":1708672711874},{"path":"D:\\workspace\\car_web\\node_modules\\css-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\workspace\\car_web\\node_modules\\vue-loader\\lib\\loaders\\stylePostLoader.js","mtime":499162500000},{"path":"D:\\workspace\\car_web\\node_modules\\postcss-loader\\src\\index.js","mtime":499162500000},{"path":"D:\\workspace\\car_web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\workspace\\car_web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":[{"type":"Buffer","data":"base64:CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKDQouZWwtdGFnICsgLmVsLXRhZyB7DQogIG1hcmdpbi1sZWZ0OiAxMHB4Ow0KfQ0K"},{"version":3,"sources":["index.vue"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA;AACA;AACA","file":"index.vue","sourceRoot":"src/components/DictTag","sourcesContent":["<template>\r\n <div>\r\n <template v-for=\"(item, index) in options\">\r\n <template v-if=\"values.includes(item.value)\">\r\n <span\r\n v-if=\"(item.raw.listClass == 'default' || item.raw.listClass == '') && (item.raw.cssClass == '' || item.raw.cssClass == null)\"\r\n :key=\"item.value\"\r\n :index=\"index\"\r\n :class=\"item.raw.cssClass\"\r\n >{{ item.label + \" \" }}</span\r\n >\r\n <el-tag\r\n v-else\r\n :disable-transitions=\"true\"\r\n :key=\"item.value\"\r\n :index=\"index\"\r\n :type=\"item.raw.listClass == 'primary' ? '' : item.raw.listClass\"\r\n :class=\"item.raw.cssClass\"\r\n >\r\n {{ item.label + \" \" }}\r\n </el-tag>\r\n </template>\r\n </template>\r\n <template v-if=\"unmatch && showValue\">\r\n {{ unmatchArray | handleArray }}\r\n </template>\r\n </div>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n name: \"DictTag\",\r\n props: {\r\n options: {\r\n type: Array,\r\n default: null,\r\n },\r\n value: [Number, String, Array],\r\n // 当未找到匹配的数据时显示value\r\n showValue: {\r\n type: Boolean,\r\n default: true,\r\n }\r\n },\r\n data() {\r\n return {\r\n unmatchArray: [], // 记录未匹配的项\r\n }\r\n },\r\n computed: {\r\n values() {\r\n if (this.value !== null && typeof this.value !== \"undefined\") {\r\n return Array.isArray(this.value) ? this.value : [String(this.value)];\r\n } else {\r\n return [];\r\n }\r\n },\r\n unmatch() {\r\n this.unmatchArray = [];\r\n if (this.value !== null && typeof this.value !== \"undefined\") {\r\n // 传入值为非数组\r\n if (!Array.isArray(this.value)) {\r\n if (this.options.some((v) => v.value == this.value)) return false;\r\n this.unmatchArray.push(this.value);\r\n return true;\r\n }\r\n // 传入值为Array\r\n this.value.forEach((item) => {\r\n if (!this.options.some((v) => v.value == item))\r\n this.unmatchArray.push(item);\r\n });\r\n return true;\r\n }\r\n // 没有value不显示\r\n return false;\r\n },\r\n },\r\n filters: {\r\n handleArray(array) {\r\n if (array.length === 0) return \"\";\r\n return array.reduce((pre, cur) => {\r\n return pre + \" \" + cur;\r\n })\r\n }\r\n }\r\n};\r\n</script>\r\n<style scoped>\r\n.el-tag + .el-tag {\r\n margin-left: 10px;\r\n}\r\n</style>\r\n"]}]}