yanzhen-design-vue
Version:
30 lines (29 loc) • 1.1 kB
JavaScript
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, toDisplayString } from "vue";
import { textPreviewName, textPreviewProps, textPreviewEmits, textPreviewOptions } from "./text-preview.mjs";
import { useTextPreview } from "./use-text-preview.mjs";
const _hoisted_1 = ["data-value", "data-native-tag"];
const _sfc_main = /* @__PURE__ */ defineComponent({
...{ name: textPreviewName, inheritAttrs: true },
__name: "text-preview",
props: textPreviewProps,
emits: textPreviewEmits,
setup(__props, { expose: __expose, emit: __emit }) {
const { ns } = textPreviewOptions;
const props = __props;
const emit = __emit;
const { _ref, previewTextRef } = useTextPreview(props, emit);
__expose({
ref: _ref
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
class: normalizeClass([unref(ns).b()]),
"data-value": props.value,
"data-native-tag": props.nativeTag
}, toDisplayString(unref(previewTextRef) ?? "-"), 11, _hoisted_1);
};
}
});
export {
_sfc_main as default
};