UNPKG

motion-v

Version:

<p align="center"> <img width="100" height="100" alt="Motion logo" src="https://user-images.githubusercontent.com/7850794/164965523-3eced4c4-6020-467e-acde-f11b7900ad62.png" /> </p> <h1 align="center">Motion for Vue</h1>

26 lines (25 loc) 628 B
import { defineComponent, getCurrentInstance, watchEffect, toDisplayString } from "vue"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "RowValue", props: { value: {} }, setup(__props) { const props = __props; const instance = getCurrentInstance().proxy; watchEffect((cleanup) => { const unSub = props.value.on("change", (value) => { if (instance.$el) { instance.$el.textContent = value; } }); cleanup(unSub); }); return (_ctx, _cache) => { return toDisplayString(_ctx.value.get()); }; } }); export { _sfc_main as default };