@opensig/opendesign
Version:
<p align="center"><img src="../docs/public/opendesign-logo-light.png"/></p> <h1 align="center">opendesign</h1> <p align="center">一个 Vue 3 组件库</p> <p align="center"><b>皮肤可定制,使用 TypeScript</b></p>
20 lines (19 loc) • 590 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const helper = require("../_utils/helper.js");
const is = require("../_utils/is.js");
const getUId = helper.uniqueId;
const vUid = {
created(el, binding) {
const value = binding.value;
if (is.isFunction(value)) {
value(el, el.id || helper.uniqueId());
} else if (is.isString(value) || is.isNumber(value)) {
el.setAttribute("id", String(value));
} else if (!el.id) {
el.setAttribute("id", helper.uniqueId());
}
}
};
exports.getUId = getUId;
exports.vUid = vUid;