UNPKG

@appscode/ui-builder

Version:
33 lines (30 loc) 722 B
import { ValidationObserver, ValidationProvider } from "vee-validate"; export default { components: { ValidationObserver, ValidationProvider, }, methods: { getRuleString(type, max_value, min_value) { let ans = ""; if (this.required) { if (type === "input" || type === "select") { ans += "required"; } else if (type === "array") { ans += "required"; } else { ans += "requiredOb"; } } if (max_value) { ans += ans ? "|" : ""; ans += `max_value:${max_value}`; } if (min_value) { ans += ans ? "|" : ""; ans += `min_value:${min_value}`; } return ans; }, }, };