vjcad 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/types.d.ts +2488 -500
- package/dist/vjcad-lib.umd.js +527 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,11 +52,24 @@ pnpm add vjcad
|
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
```javascript
|
|
55
|
-
import { MainView, initCadContainer, Engine, LineEnt } from 'vjcad';
|
|
55
|
+
import { MainView, initCadContainer, Engine, LineEnt, initLocale, registerMessages, t } from 'vjcad';
|
|
56
|
+
|
|
57
|
+
// Initialize locale first (auto-detects from URL ?lang= > localStorage > browser language)
|
|
58
|
+
initLocale(); // 'zh-CN' or 'en-US'
|
|
59
|
+
|
|
60
|
+
// Register app-level translations
|
|
61
|
+
registerMessages({
|
|
62
|
+
'zh-CN': {
|
|
63
|
+
'app.name': '唯杰WebCAD'
|
|
64
|
+
},
|
|
65
|
+
'en-US': {
|
|
66
|
+
'app.name': 'VJMap WebCAD'
|
|
67
|
+
},
|
|
68
|
+
});
|
|
56
69
|
|
|
57
70
|
// 创建 MainView 实例
|
|
58
71
|
const cadView = new MainView({
|
|
59
|
-
appname:
|
|
72
|
+
appname: t('app.name'),
|
|
60
73
|
version: "v1.0.0",
|
|
61
74
|
serviceUrl: "https://your-service-url/api/v1",
|
|
62
75
|
sidebarStyle: "none", // "none" | "left" | "right" | "both"
|