Skip to content

Commit dc99f14

Browse files
committed
feat: code optimize
1 parent b1a275b commit dc99f14

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

packages/core/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quarkc",
3-
"version": "1.0.15",
3+
"version": "1.0.16",
44
"description": "Web components quark-element",
55
"type": "module",
66
"main": "./lib/index.umd.js",
@@ -48,6 +48,12 @@
4848
"type": "git",
4949
"url": "git@github.com:hellof2e/quark.git"
5050
},
51+
"keywords": [
52+
"quarkc",
53+
"web components",
54+
"shadow dom",
55+
"custom element"
56+
],
5157
"publishConfig": {
5258
"access": "public",
5359
"registry": "https://registry.npmjs.org/"

packages/core/src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
import { createElement as h, Fragment, createRef, VNode } from './core/create-element'
22
import { render } from './core/render'
3-
43
import { PropertyDeclaration, converterFunction } from "./models"
54
import DblKeyMap from "./dblKeyMap"
65
import { EventController, EventHandler } from "./eventController"
7-
86
import {version} from '../package.json'
97

108
export function createRef() {
119
return { current: null };
1210
}
1311

14-
1512
if(~location.href.indexOf('localhost')) {
1613
console.info(`%cquarkc@${version}`, 'color: white;background:#9f57f8;font-weight:bold;font-size:10px;padding:2px 6px;border-radius: 5px','Running in dev mode.')
1714
}
1815

19-
20-
2116
const isEmpty = (val: unknown) => !(val || val === false || val === 0);
2217

2318
const defaultConverter: converterFunction = (value, type?) => {
@@ -137,6 +132,7 @@ export class QuarkElement extends HTMLElement {
137132
static h = h;
138133
static Fragment = Fragment;
139134

135+
// 外部属性装饰器,抹平不同框架使用差异
140136
protected static getPropertyDescriptor(
141137
name: string,
142138
options: PropertyDeclaration
@@ -188,6 +184,7 @@ export class QuarkElement extends HTMLElement {
188184
};
189185
}
190186

187+
// 内部属性装饰器
191188
protected static getStateDescriptor(): () => PropertyDescriptor {
192189
return (defaultValue?: any) => {
193190
let _value = defaultValue;

0 commit comments

Comments
 (0)