@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.
26 lines (25 loc) • 708 B
JavaScript
import "../chunk-G2ADBYYC.js";
import { setSubitemAttrValue, setGlobalAttrValue, getClassName, getStyle, row } from "./index";
const api = ["state"];
const renderless = (props, { computed, reactive, inject }, { parent }) => {
const api2 = {};
const state = reactive({
row: computed(() => api2.row()),
style: computed(() => api2.getStyle()),
className: computed(() => api2.getClassName()),
layout: inject("layout", {})
});
Object.assign(api2, {
state,
row: row(parent),
setGlobalAttrValue,
setSubitemAttrValue,
getStyle: getStyle({ props, state }),
getClassName: getClassName({ api: api2, props, state })
});
return api2;
};
export {
api,
renderless
};