UNPKG

@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) 527 B
import "../chunk-G2ADBYYC.js"; import { init, change } from "./index"; const api = ["state", "change"]; const renderless = (props, { onMounted, reactive, watch }, { emit }) => { const state = reactive({ options: [], selectedValue: props.modelValue }); watch( () => props.modelValue, (newValue) => state.selectedValue = newValue ); const api2 = { state, change: change(emit), init: init({ state, props, emit }) }; onMounted(api2.init); return api2; }; export { api, renderless };