create-dlightjs
Advanced tools
Comparing version
{ | ||
"name": "create-dlightjs", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"description": "DLight cli", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -6,3 +6,4 @@ import { View } from "@dlightjs/dlight" | ||
export default class App extends View { | ||
@View | ||
export default class App { | ||
count = 0 | ||
@@ -9,0 +10,0 @@ |
import { View } from "@dlightjs/dlight" | ||
import { countBtn, btnHover } from "./style.module.css" | ||
export default class Button extends View { | ||
_$content | ||
@View | ||
export default class Button { | ||
@Content content | ||
onclick | ||
@@ -10,3 +11,3 @@ btnStatus = 0 | ||
Body() { | ||
button(this._$content) | ||
button(this.content) | ||
.className(this.btnStatus[index] === 1 ? `${countBtn} ${btnHover}` : countBtn) | ||
@@ -13,0 +14,0 @@ .onclick(this.onclick) |
import { View } from "@dlightjs/dlight" | ||
import { headerWrap, navBtn, headerLogo } from "./style.module.css" | ||
class Header extends View { | ||
@View | ||
export default class Header { | ||
navList = [ | ||
{ | ||
url: "", | ||
url: "https://dlight-js.com/docs", | ||
navName: "Docs" | ||
}, | ||
{ | ||
url: "https://www.baidu.com", | ||
url: "https://dlight-js.com/examples", | ||
navName: "Examples" | ||
}, | ||
{ | ||
url: "", | ||
navName: "Tutorials" | ||
url: "https://dlight-js.com/playground", | ||
navName: "Playground" | ||
} | ||
@@ -38,3 +39,1 @@ ] | ||
} | ||
export default Header |
@@ -10,4 +10,4 @@ import { defineConfig } from 'vite' | ||
plugins: [ | ||
dlight({ appendix: [".view.js"] }), | ||
dlight({ files: "**/*.view.js" }) | ||
] | ||
}); |
@@ -10,4 +10,4 @@ import { defineConfig } from 'vite' | ||
plugins: [ | ||
dlight({ appendix: [".view.js"] }), | ||
dlight({ files: "**/*.view.js" }) | ||
] | ||
}); |
{ | ||
"compilerOptions": { | ||
"jsx": "react", | ||
"target": "ESNext", | ||
@@ -5,0 +4,0 @@ "useDefineForClassFields": true, |
@@ -10,4 +10,4 @@ import { defineConfig } from 'vite' | ||
plugins: [ | ||
dlight({ appendix: [".view.ts"] }), | ||
dlight({ files: "**/*.view.ts" }) | ||
] | ||
}); |
import { View } from "@dlightjs/dlight" | ||
import { type Typed, div, p, button, span, type Pretty } from "@dlightjs/types" | ||
import { type Typed, div, p, button, span, type Pretty, SubTyped } from "@dlightjs/types" | ||
import Header from "./Header.view" | ||
import { wrap, slogan2, countWrap, countBtn, btnHover, btnWrap, countText, colorD, colorL, m0 } from "./style.module.css" | ||
class App extends View { | ||
interface BtnProps { | ||
content: string | ||
onclick: () => void | ||
index: number | ||
} | ||
@View | ||
class App { | ||
count = 0 | ||
btnStatus = [0, 0] | ||
@View | ||
Btn({ _$content, onclick, index }: any): any { | ||
button(_$content) | ||
Btn = (({ content, onclick, index }: BtnProps) => { | ||
button(content) | ||
.className(this.btnStatus[index] === 1 ? `${countBtn} ${btnHover}` : countBtn) | ||
@@ -22,3 +29,3 @@ .onclick(onclick) | ||
}) | ||
} | ||
}) as any as SubTyped<BtnProps> | ||
@@ -25,0 +32,0 @@ |
import { View } from "@dlightjs/dlight" | ||
import { headerWrap, navBtn, headerLogo } from "./style.module.css" | ||
import { type Typed, div, img, a type Pretty } from "@dlightjs/types" | ||
import { type Typed, div, img, a, type Pretty } from "@dlightjs/types" | ||
class Header extends View { | ||
interface NavProps { | ||
url: string | ||
navName: string | ||
} | ||
@View | ||
class Header { | ||
navList = [ | ||
{ | ||
url: "", | ||
url: "https://dlight-js.com/docs", | ||
navName: "Docs" | ||
}, | ||
{ | ||
url: "https://www.baidu.com", | ||
url: "https://dlight-js.com/examples", | ||
navName: "Examples" | ||
}, | ||
{ | ||
url: "", | ||
navName: "Tutorials" | ||
url: "https://dlight-js.com/playground", | ||
navName: "Playground" | ||
} | ||
@@ -22,7 +28,7 @@ ] | ||
@View | ||
Nav({ url, navName }: any): any { | ||
Nav = (({ url, navName }: NavProps) => { | ||
a(navName) | ||
.className(navBtn) | ||
.href(url) | ||
} | ||
}) as any as Typed<NavProps> | ||
@@ -39,3 +45,3 @@ Body() { | ||
for (const navItem of this.navList) { | ||
this.Nav({}) | ||
this.Nav() | ||
.url(navItem.url) | ||
@@ -42,0 +48,0 @@ .navName(navItem.navName) |
{ | ||
"compilerOptions": { | ||
"jsx": "react", | ||
"target": "ESNext", | ||
@@ -5,0 +4,0 @@ "useDefineForClassFields": true, |
@@ -10,4 +10,4 @@ import { defineConfig } from 'vite' | ||
plugins: [ | ||
dlight({ appendix: [".view.ts"] }), | ||
dlight({ files: "**/*.view.ts" }) | ||
] | ||
}); |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
58278
0.45%620
1.81%