birdpaper-ui
Version:
一个通用的 vue3 UI组件库。A common vue3 UI component library.
35 lines (34 loc) • 1.03 kB
JavaScript
import { defineComponent, ref, watchEffect, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString } from "vue";
const _hoisted_1 = ["textContent"];
const __default__ = defineComponent({
name: "PaginationTotal"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
props: {
value: { type: Number, default: 0 },
tmpString: { type: String, default: "" }
},
setup(__props) {
const props = __props;
const name = "bp-pagination";
const paramsStr = "{total}";
const text = ref("");
watchEffect(() => {
text.value = props.tmpString.replace(paramsStr, props.value);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
class: normalizeClass([`${name}-item`, `${name}-total`])
}, [
createElementVNode("span", {
class: "page-text",
textContent: toDisplayString(text.value)
}, null, 8, _hoisted_1)
], 2);
};
}
});
export {
_sfc_main as default
};