例如:
geddy gen scaffold person name:default
和
geddy gen scaffold person name
都使用数据类型“string”创建属性“name”。这两种语法之间有什么区别吗?
答案 0 :(得分:0)
来自Geddy文档:
$ geddy gen scaffold user name:default
This example creates scaffolding but includes name as the default property that will be used when displaying the content in the views.
In this example the property name is given the type string because no type was given. You could have also written name:string:default (or some other type in place of 'string'). If no default property is given Geddy will use id as the default display property.
当您提供不带类型Geddy的属性时,它的类型为string
。
default
告诉Geddy使用该属性而不是id
属性作为默认显示属性。
例如:如果您执行了$ geddy gen scaffold user name:default
Geddy将生成属性name
作为字符串,并在创建index.html
属性后user
生成将显示在列表中的是name
而不是id
。