Files
console-dev/app/components/ProductGroupLabel.vue
T
2026-11-06 00:04:38 +08:00

78 lines
1.8 KiB
Vue

<script>
import "~/assets/styles/ProductGroupLabel.B1kWpFA-.css";
import { toDisplayString } from "vue";
import { createCommentVNode } from "vue";
import { computed } from "vue";
import { createElementBlock } from "vue";
import { createElementVNode } from "vue";
import { unref } from "vue";
import { defineComponent } from "vue";
import { openBlock } from "vue";
import { t as _plugin_vue_export_helper_t } from "~/lib/_plugin-vue_export-helper.js";
function l(e) {
let t = typeof e == `string` ? e.trim() : ``,
n = t.indexOf(`-N`);
if (n < 0)
return {
name: t,
badge: ``,
};
let r = t.slice(0, n).trim(),
i = t.slice(n + 2).trim();
return r && i
? {
name: r,
badge: i,
}
: {
name: t,
badge: ``,
};
}
var u = {
class: `product-group-label`,
},
d = {
class: `product-group-name`,
},
f = {
key: 0,
class: `product-group-badge`,
},
p = Object.assign(
_plugin_vue_export_helper_t(
defineComponent({
__name: `ProductGroupLabel`,
props: {
name: {},
},
setup(o) {
let c = o,
p = computed(() => l(c.name));
return (n, o) => (
openBlock(),
createElementBlock(`span`, u, [
createElementVNode(`span`, d, toDisplayString(unref(p).name), 1),
unref(p).badge
? (openBlock(),
createElementBlock(
`span`,
f,
toDisplayString(unref(p).badge),
1,
))
: createCommentVNode(``, !0),
])
);
},
}),
[[`__scopeId`, `data-v-6806c62d`]],
),
{
__name: `ProductGroupLabel`,
},
);
export { l as n };
export default p;
</script>