Skip to content

Commit

Permalink
improve: minor change dev code
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Jun 16, 2016
1 parent 52fc88c commit 84b0a2c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
7 changes: 7 additions & 0 deletions dev/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import Vue from "vue";
import VueFormGenerator from "../src";
import DataTable from "./dataTable.vue";
import Fakerator from "fakerator";
import Schema from "./schema";
import { users } from "./data";
Expand All @@ -42,6 +43,8 @@
Vue.use(VueFormGenerator);
let fakerator = new Fakerator();
export default {
components: {
DataTable
Expand Down Expand Up @@ -181,6 +184,10 @@
ready() {
window.app = this;
if (users.length > 0) {
this.selectRow(null, fakerator.random.arrayElement(users));
}
}
}
Expand Down
31 changes: 16 additions & 15 deletions dev/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = {
fields: [
{
type: "text",
label: "ID",
label: "ID (disabled text field)",
model: "id",
readonly: true,
editableIfNew: true, // TODO
Expand All @@ -19,7 +19,7 @@ module.exports = {
},
{
type: "select",
label: "Type",
label: "Type (select field)",
model: "type",
required: true,
values: [
Expand Down Expand Up @@ -70,7 +70,7 @@ module.exports = {
},
{
type: "password",
label: "Password",
label: "Password (password field)",
model: "password",
min: 6,
required: true,
Expand All @@ -81,7 +81,7 @@ module.exports = {

{
type: "selectEx",
label: "Skills",
label: "Skills (selectEx field)",
model: "skills",
multi: true,
required: true,
Expand Down Expand Up @@ -128,7 +128,7 @@ module.exports = {
},
{
type: "email",
label: "E-mail",
label: "E-mail (email field)",
model: "email",
placeholder: "User's e-mail address"
},
Expand All @@ -145,15 +145,15 @@ module.exports = {
},
{
type: "masked",
label: "Mobile",
label: "Mobile (masked field)",
model: "mobile",
mask: "(99) 999-9999",
styleClasses: "half-width",
validator: validators.required
},
{
type: "spectrum",
label: "Color",
label: "Color (spectrum field)",
model: "favoriteColor",
required: true,
colorOptions: {
Expand All @@ -163,7 +163,7 @@ module.exports = {
},
{
type: "image",
label: "Avatar",
label: "Avatar (image field)",
model: "avatar",
required: true,
browse: true,
Expand All @@ -172,7 +172,7 @@ module.exports = {
},
{
type: "number",
label: "Age",
label: "Age (number field)",
model: "age",
multi: true,
disabled: true,
Expand All @@ -187,7 +187,7 @@ module.exports = {
},
{
type: "dateTime",
label: "DOB",
label: "DOB (dateTime field)",
model: "dob",
required: true,
placeholder: "User's birth of date",
Expand Down Expand Up @@ -236,7 +236,7 @@ module.exports = {

{
type: "slider",
label: "Rank",
label: "Rank (slider field)",
model: "rank",
multi: true,
min: 1,
Expand Down Expand Up @@ -289,12 +289,13 @@ module.exports = {
{ id: "it", name: "Italic" },
{ id: "fr", name: "French" }
],
hint: "Your native language",
styleClasses: "half-width",
validator: validators.required
},
{
type: "selectEx",
label: "Country",
label: "Country (selectEx field)",
model: "address.country",
multi: true,
required: true,
Expand Down Expand Up @@ -390,13 +391,13 @@ module.exports = {
},
{
type: "label",
label: "Created",
label: "Created (label field)",
model: "created",
get(model) { return model && model.created ? moment(model.created).format("LLL") : "-"; }
},
{
type: "switch",
label: "Status",
label: "Status (switch field)",
model: "status",
multi: true,
default: true,
Expand All @@ -405,7 +406,7 @@ module.exports = {
},
{
type: "textArea",
label: "Biography",
label: "Biography (textArea field)",
model: "bio",
hint: "Max 500 characters",
max: 500,
Expand Down

0 comments on commit 84b0a2c

Please sign in to comment.