92 lines
2.9 KiB
Vue
92 lines
2.9 KiB
Vue
<script>
|
|
import "~/assets/styles/ProductCategoryNotice.CwaR3eXN.css";
|
|
import { normalizeClass } 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";
|
|
import { n as sanitize_n } from "~/lib/sanitize.js";
|
|
var u = {
|
|
key: 0,
|
|
class: `category-notice`,
|
|
"aria-label": `分类订购提示`,
|
|
"aria-live": `polite`,
|
|
"aria-atomic": `true`,
|
|
},
|
|
d = [`innerHTML`],
|
|
f = Object.assign(
|
|
_plugin_vue_export_helper_t(
|
|
defineComponent({
|
|
__name: `ProductCategoryNotice`,
|
|
props: {
|
|
description: {},
|
|
},
|
|
setup(o) {
|
|
let c = o,
|
|
f = computed(() => {
|
|
let e = typeof c.description == `string` ? c.description : ``;
|
|
for (let t = 0; t < 2; t++) {
|
|
let t = new DOMParser().parseFromString(e, `text/html`);
|
|
if (t.body.childElementCount || t.head.childElementCount) break;
|
|
let n = t.body.textContent ?? e;
|
|
if (n === e) break;
|
|
e = n;
|
|
}
|
|
let t = sanitize_n(e),
|
|
n = new DOMParser().parseFromString(t, `text/html`);
|
|
return {
|
|
html:
|
|
n.body.textContent
|
|
?.replace(/[\u200b-\u200d\ufeff]/g, ``)
|
|
.trim() || n.body.querySelector(`img[src]`)
|
|
? t
|
|
: ``,
|
|
plain: n.body.childElementCount === 0,
|
|
};
|
|
});
|
|
return (n, o) =>
|
|
unref(f).html
|
|
? (openBlock(),
|
|
createElementBlock(`aside`, u, [
|
|
(o[0] ||= createElementVNode(
|
|
`i`,
|
|
{
|
|
class: `pi pi-info-circle category-notice-icon`,
|
|
"aria-hidden": `true`,
|
|
},
|
|
null,
|
|
-1,
|
|
)),
|
|
createElementVNode(
|
|
`div`,
|
|
{
|
|
class: normalizeClass([
|
|
`category-notice-content`,
|
|
{
|
|
"category-notice-plain": unref(f).plain,
|
|
},
|
|
]),
|
|
innerHTML: unref(f).html,
|
|
},
|
|
null,
|
|
10,
|
|
d,
|
|
),
|
|
]))
|
|
: createCommentVNode(``, !0);
|
|
},
|
|
}),
|
|
[[`__scopeId`, `data-v-faa6a7a3`]],
|
|
),
|
|
{
|
|
__name: `ProductCategoryNotice`,
|
|
},
|
|
);
|
|
export {};
|
|
export default f;
|
|
</script>
|