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.

32 lines (31 loc) 692 B
import "../chunk-G2ADBYYC.js"; import { change, draw } from "."; const api = ["state"]; const renderless = (props, { reactive, watch, onMounted }, { vm, emit }, { QRCode }) => { const api2 = {}; const state = reactive({ sizeStr: "", iconSizeStr: "", iconBackgroudColor: "" }); Object.assign(api2, { state, draw: draw({ props, state, vm, QRCode }), change: change(emit) }); onMounted(() => { api2.draw(); }); watch( () => [props.level, props.value, props.color, props.style, props.size, props.icon, props.iconSize, props.bordered], () => { api2.draw(); api2.change(); } ); return api2; }; export { api, renderless };