@viewfly/platform-browser 3.0.1 → 3.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.en.md +58 -0
- package/README.md +2 -0
- package/package.json +2 -2
package/README.en.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @viewfly/platform-browser
|
|
2
|
+
|
|
3
|
+
**Languages:** [简体中文](./README.md)
|
|
4
|
+
|
|
5
|
+
Browser entrypoint for Viewfly apps: create the root app, mount to the DOM, destroy, and related DOM-facing APIs.
|
|
6
|
+
|
|
7
|
+
Install and configure **`@viewfly/core`** first (JSX, `reflect-metadata`, etc.).
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @viewfly/platform-browser @viewfly/core
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Create and mount
|
|
20
|
+
|
|
21
|
+
HTML mount target:
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<div id="app"></div>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Script:
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { createApp } from '@viewfly/platform-browser'
|
|
31
|
+
|
|
32
|
+
function App() {
|
|
33
|
+
return () => <div>Hello Viewfly</div>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const app = createApp(<App />)
|
|
37
|
+
app.mount(document.getElementById('app')!)
|
|
38
|
+
|
|
39
|
+
// when needed
|
|
40
|
+
app.destroy()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
Refer to typings and the official docs for full API surface.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Docs
|
|
50
|
+
|
|
51
|
+
- Official site: <https://viewfly.org> (creating an app, lifecycle).
|
|
52
|
+
- **`@viewfly/platform-browser`** typings for parameter/return details.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
MIT
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viewfly/platform-browser",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "This project is used to enable the Viewfly framework to run in a browser.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"keywords": [],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@viewfly/core": "^3.0.
|
|
21
|
+
"@viewfly/core": "^3.0.2",
|
|
22
22
|
"csstype": "^3.1.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|