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.
IOReportMgt/IOReportSysMP/miniprogram/components/sysTextarea/sysTextarea.js

41 lines
1.4 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,
label: String,
},
relations: {
'../yform/yform': {
type: 'ancestor',
linked: function (target) {
var _this = this;
this.updateFormItemValue = function (curValue) {
target.data.form[_this.data.bindValue] = curValue;
_this.setData({ value: curValue });
};
}
}
},
lifetimes: {
attached: function () {
var initValue = this.data.defaultValue || '';
this.dataset[this.data.bindValue] = initValue;
this.setData({ value: initValue });
}
},
methods: {
// 这个方法是父组件提供的,这里只是为了不报错
updateFormItemValue: function (_) { },
bindinput: function (event) {
this.dataset[this.data.bindValue] = event.detail.value;
this.updateFormItemValue(event.detail.value);
}
}
});