feat: 门票组件封装
This commit is contained in:
34
unpackage/dist/dev/mp-weixin/components/FormCard/index.js
vendored
Normal file
34
unpackage/dist/dev/mp-weixin/components/FormCard/index.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
__name: "index",
|
||||
setup(__props) {
|
||||
const name = common_vendor.ref("");
|
||||
const phone = common_vendor.ref("");
|
||||
const phoneError = common_vendor.ref("");
|
||||
const validatePhone = () => {
|
||||
const phoneRegex = /^1[3-9]\d{9}$/;
|
||||
if (!phone.value) {
|
||||
phoneError.value = "手机号不能为空";
|
||||
} else if (!phoneRegex.test(phone.value)) {
|
||||
phoneError.value = "请输入正确的手机号";
|
||||
} else {
|
||||
phoneError.value = "";
|
||||
}
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return {
|
||||
a: common_assets._imports_0$11,
|
||||
b: name.value,
|
||||
c: common_vendor.o(($event) => name.value = $event.detail.value),
|
||||
d: common_vendor.o(validatePhone),
|
||||
e: phone.value,
|
||||
f: common_vendor.o(($event) => phone.value = $event.detail.value)
|
||||
};
|
||||
};
|
||||
}
|
||||
};
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-5787c07e"]]);
|
||||
wx.createComponent(Component);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/FormCard/index.js.map
|
||||
Reference in New Issue
Block a user