@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.
31 lines (30 loc) • 855 B
JavaScript
import "../chunk-G2ADBYYC.js";
import { getRoute, computedDataList, computedMoreLink, handleBulletinBoardClick } from "./index";
const api = ["state", "getRoute", "handleBulletinBoardClick"];
const renderless = (props, { reactive, computed, watch }, { emit }) => {
const api2 = {};
const state = reactive({
actName: props.activeName,
dataList: computed(() => api2.computedDataList()),
moreLink: computed(() => api2.computedMoreLink())
});
watch(
() => props.activeName,
(value) => {
state.actName = value;
},
{ immediate: true }
);
Object.assign(api2, {
state,
getRoute,
computedDataList: computedDataList({ props, state }),
computedMoreLink: computedMoreLink({ props }),
handleBulletinBoardClick: handleBulletinBoardClick({ emit })
});
return api2;
};
export {
api,
renderless
};