Skip to content

Commit b3568ca

Browse files
committed
chore: 优化组件
1 parent b4a1109 commit b3568ca

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
AppName = "QuarkGo"
2323

2424
// 版本号
25-
Version = "3.8.1"
25+
Version = "3.8.2"
2626

2727
// 包名
2828
PkgName = "github.com/quarkcloudio/quark-go/v3"

template/admin/component/component/element.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ type Element struct {
1616
const DEFAULT_KEY = ""
1717
const DEFAULT_CRYPT = true
1818

19+
// 初始化
20+
func New() *Element {
21+
return &Element{}
22+
}
23+
24+
// 设置Component
25+
func (p *Element) SetComponent(component string) *Element {
26+
p.Component = component
27+
p.SetKey(component, true)
28+
return p
29+
}
30+
1931
// 设置Key
2032
func (p *Element) SetKey(key string, crypt bool) *Element {
2133
if key == "" {

0 commit comments

Comments
 (0)