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.

64 lines (63 loc) 1.11 kB
import "../chunk-G2ADBYYC.js"; import { initApi, initState, initWatch } from "./index"; const api = [ "state", "open", "close", "resetColor", "onConfirm", "onCancel", "submitValue", "clear", "onHueReady", "onSvReady", "onAlphaReady", "onPredefineColorClick", "onHistoryClick", "onClickOutside" ]; const renderless = (props, hooks, utils) => { const state = initState(props, hooks); const { open, close, resetColor, onConfirm, onCancel, submitValue, clear, onHueReady, onSvReady, onAlphaReady, onPredefineColorClick, onHistoryClick, onClickOutside } = initApi(props, state, utils); const api2 = { state, open, close, resetColor, onConfirm, onCancel, submitValue, clear, onHueReady, onSvReady, onAlphaReady, onPredefineColorClick, onHistoryClick, onClickOutside }; initWatch(state, props, hooks, utils); hooks.onMounted(() => { if (props.modelValue) { state.input = state.currentColor; } }); return api2; }; export { api, renderless };