|
1 | 1 | import { createElement as h, Fragment, createRef, VNode } from './core/create-element' |
2 | 2 | import { render } from './core/render' |
3 | | - |
4 | 3 | import { PropertyDeclaration, converterFunction } from "./models" |
5 | 4 | import DblKeyMap from "./dblKeyMap" |
6 | 5 | import { EventController, EventHandler } from "./eventController" |
7 | | - |
8 | 6 | import {version} from '../package.json' |
9 | 7 |
|
10 | 8 | export function createRef() { |
11 | 9 | return { current: null }; |
12 | 10 | } |
13 | 11 |
|
14 | | - |
15 | 12 | if(~location.href.indexOf('localhost')) { |
16 | 13 | console.info(`%cquarkc@${version}`, 'color: white;background:#9f57f8;font-weight:bold;font-size:10px;padding:2px 6px;border-radius: 5px','Running in dev mode.') |
17 | 14 | } |
18 | 15 |
|
19 | | - |
20 | | - |
21 | 16 | const isEmpty = (val: unknown) => !(val || val === false || val === 0); |
22 | 17 |
|
23 | 18 | const defaultConverter: converterFunction = (value, type?) => { |
@@ -137,6 +132,7 @@ export class QuarkElement extends HTMLElement { |
137 | 132 | static h = h; |
138 | 133 | static Fragment = Fragment; |
139 | 134 |
|
| 135 | + // 外部属性装饰器,抹平不同框架使用差异 |
140 | 136 | protected static getPropertyDescriptor( |
141 | 137 | name: string, |
142 | 138 | options: PropertyDeclaration |
@@ -188,6 +184,7 @@ export class QuarkElement extends HTMLElement { |
188 | 184 | }; |
189 | 185 | } |
190 | 186 |
|
| 187 | + // 内部属性装饰器 |
191 | 188 | protected static getStateDescriptor(): () => PropertyDescriptor { |
192 | 189 | return (defaultValue?: any) => { |
193 | 190 | let _value = defaultValue; |
|
0 commit comments