问题
I am currently customizing Telescope heavily, which is written in Meteor.
I need to go over the 3,000 character defined in Telescope's Posts
schema's body
defined here in the source.
I've been able to customize the HTML and JS, but not the models. How would I do so?
回答1:
Just create a file under your lib
folder and use the documentation here: http://docs.telescopeapp.org/docs/custom-fields to remove or add fields to that Schema.
EDIT: Sorry, but reading carefully your comment I understood you want to modify the autoForm props rather than the Schema itself. To change the maximum allowed value, do something along these lines:
Posts.removeField("body");
Posts.addField({
fieldName: 'body',
fieldSchema: {
type: String,
optional: true,
max: 5000,
editableBy: ["member", "admin"],
autoform: {
placeholder: 'Cannot exceed the maximum length of 5000 characters',
row: 10,
type: 'textarea'
}
}
});
来源:https://stackoverflow.com/questions/34306509/override-schema-defined-in-telescopemeteor