@type-dom/svgs 0.1.5 → 0.1.7

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.
Files changed (2) hide show
  1. package/README.md +72 -72
  2. package/package.json +2 -7
package/README.md CHANGED
@@ -1,72 +1,72 @@
1
- ## TypeDomSvgs
2
-
3
- > 这是一个基于前端框架TypeDom创建的svg组件库。
4
-
5
- ## Usage
6
-
7
- ### Install the lib
8
-
9
- ```bash
10
- # or pnpm or yarn
11
- npm install @type-dom/svgs
12
- ```
13
-
14
- ```ts
15
- // Typescript Webpack
16
- import {Br, Division, TypeRoot, TextNode} from '@type-dom/framework';
17
- import {AddSvg} from '@type-dom/svgs';
18
- // svgs-root.ts 项目根节点
19
- export class AppElement extends TypeRoot {
20
- className: 'AppElement';
21
- constructor(editorEl: HTMLElement) {
22
- super();
23
- this.className = 'AppElement';
24
- this.attr.addObj({ // 设置根节点的属性
25
- name: 'app-root'
26
- })
27
- this.style.addObj({ // 设置根节点样式
28
- padding: '30px',
29
- border: '20px solid #dddddd'
30
- });
31
- this.addChild(
32
- new Div({ // 子节点
33
- childNodes: [
34
- new AddSvg(), // 加号图标
35
- ]
36
- }),
37
- new Br()
38
- );
39
- this.mount(); // 渲染
40
- }
41
- }
42
-
43
- // main.ts 项目主程序
44
- // 监听 DOMContentLoaded 事件
45
- document.addEventListener('DOMContentLoaded', function() {
46
- // 获取页面中的某个特定元素
47
- const uiEl = document.querySelector('#example-ref') as HTMLElement;
48
- if (uiEl) {
49
- // 实例化 AppElement 组件
50
- const view = new AppElement(uiEl);
51
- } else {
52
- console.error('#example-ref 元素未找到');
53
- }
54
- });
55
-
56
- ```
57
-
58
- ```html
59
- // index.html
60
- <!DOCTYPE html>
61
- <html lang="en" xmlns="http://www.w3.org/1999/html">
62
- <head>
63
- <meta charset="UTF-8"/>
64
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
65
- <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
66
- <title>type dom svgs </title>
67
- </head>
68
- <body>
69
- <div id="example-ref"></div>
70
- </body>
71
- </html>
72
- ```
1
+ ## TypeDomSvgs
2
+
3
+ > 这是一个基于前端框架TypeDom创建的svg组件库。
4
+
5
+ ## Usage
6
+
7
+ ### Install the lib
8
+
9
+ ```bash
10
+ # or pnpm or yarn
11
+ npm install @type-dom/svgs
12
+ ```
13
+
14
+ ```ts
15
+ // Typescript Webpack
16
+ import {Br, Division, TypeRoot, TextNode} from '@type-dom/framework';
17
+ import {AddSvg} from '@type-dom/svgs';
18
+ // svgs-root.ts 项目根节点
19
+ export class AppElement extends TypeRoot {
20
+ className: 'AppElement';
21
+ constructor(editorEl: HTMLElement) {
22
+ super();
23
+ this.className = 'AppElement';
24
+ this.attr.addObj({ // 设置根节点的属性
25
+ name: 'app-root'
26
+ })
27
+ this.style.addObj({ // 设置根节点样式
28
+ padding: '30px',
29
+ border: '20px solid #dddddd'
30
+ });
31
+ this.addChild(
32
+ new Div({ // 子节点
33
+ childNodes: [
34
+ new AddSvg(), // 加号图标
35
+ ]
36
+ }),
37
+ new Br()
38
+ );
39
+ this.mount(); // 渲染
40
+ }
41
+ }
42
+
43
+ // main.ts 项目主程序
44
+ // 监听 DOMContentLoaded 事件
45
+ document.addEventListener('DOMContentLoaded', function() {
46
+ // 获取页面中的某个特定元素
47
+ const uiEl = document.querySelector('#example-ref') as HTMLElement;
48
+ if (uiEl) {
49
+ // 实例化 AppElement 组件
50
+ const view = new AppElement(uiEl);
51
+ } else {
52
+ console.error('#example-ref 元素未找到');
53
+ }
54
+ });
55
+
56
+ ```
57
+
58
+ ```html
59
+ // index.html
60
+ <!DOCTYPE html>
61
+ <html lang="en" xmlns="http://www.w3.org/1999/html">
62
+ <head>
63
+ <meta charset="UTF-8"/>
64
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
65
+ <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
66
+ <title>type dom svgs </title>
67
+ </head>
68
+ <body>
69
+ <div id="example-ref"></div>
70
+ </body>
71
+ </html>
72
+ ```
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@type-dom/svgs",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "dependencies": {
5
- "@type-dom/framework": "*",
6
- "tslib": "^2.3.0"
5
+ "@type-dom/framework": "*"
7
6
  },
8
7
  "type": "commonjs",
9
8
  "main": "./src/index.js",
@@ -12,9 +11,5 @@
12
11
  "type": "git",
13
12
  "url": "git+https://github.com/type-dom/svgs.git"
14
13
  },
15
- "publishConfig": {
16
- "access": "public",
17
- "registry": "https://registry.npmjs.org/"
18
- },
19
14
  "types": "./src/index.d.ts"
20
15
  }