You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.3 KiB

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var yfieldsControls_1 = __importDefault(require("../yfieldsControls"));
Component({
behaviors: [yfieldsControls_1.default],
properties: {
bindValue: String,
defaultValue: String,
placeholder: {
type: String,
value: "请输入",
},
},
relations: {
'../yform/yform': {
type: 'ancestor',
linked: function (target) {
var _this = this;
this.updateFormItemValue = function (curValue) {
target.data.form[_this.data.bindValue] = curValue;
};
}
}
},
lifetimes: {
attached: function () {
var _a;
this.dataset[this.data.bindValue] = (_a = this.data.defaultValue) !== null && _a !== void 0 ? _a : '';
}
},
methods: {
// 这个方法是父组件提供的,这里只是为了不报错
updateFormItemValue: function (data) { },
bindinput: function (event) {
this.dataset[this.data.bindValue] = event.detail.value;
this.updateFormItemValue(event.detail.value);
}
}
});