ο»Ώ# Razor - CrossPlatform Hybrid Starter
English πΊπΈ | δΈζ π¨π³
With a deadly lightning storm at his command, Razor charges into battle.
Use front-end tech (Vue/Css/Ts) to build multi-platform from one codebase,
Suitable for teams and app scenarios such as,
MC
layer can be reused, but the V
layer UX
is differentThe goal is write logic once, run anywhere
learn once
write once
cli
MITBased on the Vue Style Guide, with the principles of type safety, readability, and consistency, add the following conventions,
First, html
and http
are case-insensitive, and mac
and win
OS are case-insensitive by default.
camel
- camelCase
(small) and PascalCase
(big)kebab
- kebab-case
all lowercase*.vue
file - MUST be big-camel
, consistent with Vue officialkebab
consistent with index.js
camel
, html attr and css MUST be kebab
big-camel
, to distinguish from original htmlsmall-camel
, in html MUST be kebab
kebab
, treated as string, no auto-conversioncamel
Since double quotes are usually used in html which may contain simple js code,
semicolon, same as your main language, or otherwise as they are.
comma, as much as possible to easy to add, sub and reorder,
Index.*
Components named Index are hard to read, debug and develop.
import
and export
via index.ts)name
attribute (auto inference is recommended)According to the official Vue naming rules, most things are plural,
function
is better than arrow
lambdaunknown
instead of any
*.ts
, type-only is in *.d.ts
TypeX[]
instead of Array<TypeX>
when no type inferenceif
for flow control, ||
or ??
for expression@/
), relative path is only . /
and ../
on
prefixdo
prefix for handle
when passthrough Function.d.ts
, but enum in .ts