Skip to content

Commit

Permalink
feat: remove enableGlobalClass
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Mar 18, 2019
1 parent 5c0b06d commit a8d8f30
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion src/components/FormIdCollector/Collector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { component, RequiredProp } from '../component'
import Self from './Collector'

export default class Collector extends component({
enableGlobalClass: true,
props: {
count: 0 as any as RequiredProp<number>,
onCollect: noop as any as RequiredProp<
Expand Down
1 change: 0 additions & 1 deletion src/components/FormIdCollector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Collector from './Collector'
* Form Id 收集组件。
*/
export default class MFormIdCollector extends component({
enableGlobalClass: true,
props: {
/** 每次点击的收集个数 */
count: 1 as number,
Expand Down
1 change: 0 additions & 1 deletion src/components/Picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import MPopup from '../Popup'
import defaultProps from './defaultProps'

class MPicker<D extends Data, V extends (D extends Data<infer VV> ? VV : any) = any> extends component({
enableGlobalClass: true,
props: defaultProps,
state: {
localVisible: false as boolean,
Expand Down
1 change: 0 additions & 1 deletion src/components/PickerView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export type ColData<V = any> = NormalColData<V> | CascadedColData<V>
export type Data<V = any> = NormalData<V> | CascadedData<V>

class MPickerView<D extends Data, V extends (D extends Data<infer VV> ? VV : any) = any> extends component({
enableGlobalClass: true,
props: {
...defaultProps,
onPickStart: noop as () => void,
Expand Down
1 change: 0 additions & 1 deletion src/components/Popup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const positionToTransitionName: { [key in Position]: MTransition['props']['name'
* 弹出层组件。
*/
class MPopup extends component({
enableGlobalClass: true,
props: {
/** 弹出层是否可见 */
visible: false as any as RequiredProp<boolean>,
Expand Down
1 change: 0 additions & 1 deletion src/components/SinglePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import MPicker from '../Picker'
import defaultProps from './defaultProps'

class MSinglePicker<D extends NormalColData, V extends (D extends NormalColData<infer VV> ? VV : any) = any> extends component({
enableGlobalClass: true,
props: defaultProps,
state: {
localData: [],
Expand Down
1 change: 0 additions & 1 deletion src/components/Sticky/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const stickyComponents: MSticky[] = []
* 吸顶组件。
*/
class MSticky extends component({
enableGlobalClass: true,
state: {
/** 是否置顶 */
fixed: false as boolean,
Expand Down
1 change: 0 additions & 1 deletion src/components/Transition/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum TransitionType {
* 动画过渡组件。
*/
export default class MTransition extends component({
enableGlobalClass: true,
props: {
/** 组件是否可见 */
visible: true as any as RequiredProp<boolean>,
Expand Down
4 changes: 1 addition & 3 deletions src/components/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ const component = <
SS = S
>(
{
enableGlobalClass = false,
props = {} as any,
state = {} as any,
}: {
enableGlobalClass?: boolean,
props?: P,
state?: S,
} = {} as any,
Expand All @@ -43,7 +41,7 @@ const component = <
Overwrite<SS, ExtraState>
> {
static options: wx.ComponentOptions = {
addGlobalClass: enableGlobalClass,
addGlobalClass: true,
}

static defaultProps: P = props
Expand Down

0 comments on commit a8d8f30

Please sign in to comment.