UNPKG

@mee4dy/crud

Version:

Create a backend and frontend in 5 minutes! With our powerful full stack crud system, customize it to suit you.

45 lines (44 loc) 1.27 kB
/* empty css */ import s from "../../../../../_virtual/_plugin-vue2_normalizer.js"; const c = { props: { data: { type: Object } }, computed: { percent() { var a; const { field: t, item: e, value: r } = this.data; if (!((a = t == null ? void 0 : t.percent) != null && a.from)) return; const n = e[t.percent.from]; return n > 0 && r > 0 ? (+r / +n * 100).toFixed(2) : 0; }, precision() { var t, e; return (e = (t = this.data) == null ? void 0 : t.field) == null ? void 0 : e.precision; } }, filters: { number(t, e = " ", r = 0) { return (Math.round(parseFloat(t) * 100) / 100).toFixed(r).toString().replace(/,/g, "").replace(/\B(?=(\d{3})+(?!\d))/g, e); } } }; var o = function() { var e = this, r = e._self._c; return r("div", { staticClass: "crud-ui-table-td-number" }, [e.data.value ? [e._v(" " + e._s(e._f("number")(e.data.value, " ", e.precision)) + " ")] : [e._v("0")], e.percent !== void 0 ? r("span", { staticClass: "percent" }, [e._v(e._s(e.percent) + "%")]) : e._e()], 2); }, i = [], p = /* @__PURE__ */ s( c, o, i, !1, null, "f945707b" ); const _ = p.exports; export { _ as default }; //# sourceMappingURL=Number.vue.js.map