@opentiny/vue-renderless
Version:
An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
25 lines (24 loc) • 776 B
JavaScript
import "../chunk-G2ADBYYC.js";
import { computedContent, computedValueRef, computedTransform } from "./index";
import { xss } from "@opentiny/utils";
const api = ["state"];
const renderless = (props, { computed, reactive }, { designConfig }) => {
const state = reactive({
isOverstep: false,
valueRef: computed(() => api2.computedValueRef()),
content: computed(() => api2.computedContent()),
href: computed(() => xss.filterUrl(props.href)),
transform: computed(() => api2.computedTransform())
});
const api2 = {
state,
computedValueRef: computedValueRef({ props }),
computedContent: computedContent({ props, state }),
computedTransform: computedTransform({ props, designConfig })
};
return api2;
};
export {
api,
renderless
};