[improvement] rename use to createNamespace (#3658)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { use } from '../../utils';
|
||||
import { createNamespace } from '../../utils';
|
||||
import { inherit } from '../../utils/functional';
|
||||
import Button from '../../button';
|
||||
|
||||
@@ -12,7 +12,7 @@ export type SkuActionsProps = {
|
||||
showAddCartBtn?: boolean;
|
||||
};
|
||||
|
||||
const [sfc, bem] = use('sku-actions');
|
||||
const [createComponent, bem] = createNamespace('sku-actions');
|
||||
|
||||
function SkuActions(
|
||||
h: CreateElement,
|
||||
@@ -52,4 +52,4 @@ SkuActions.props = {
|
||||
showAddCartBtn: Boolean
|
||||
};
|
||||
|
||||
export default sfc<SkuActionsProps>(SkuActions);
|
||||
export default createComponent<SkuActionsProps>(SkuActions);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { use } from '../../utils';
|
||||
import { createNamespace } from '../../utils';
|
||||
import { inherit } from '../../utils/functional';
|
||||
import Icon from '../../icon';
|
||||
|
||||
@@ -14,7 +14,7 @@ export type SkuHeaderProps = {
|
||||
selectedSku: SelectedSkuData;
|
||||
};
|
||||
|
||||
const [sfc, bem] = use('sku-header');
|
||||
const [createComponent, bem] = createNamespace('sku-header');
|
||||
|
||||
function getSkuImg(sku: SkuData, selectedSku: SelectedSkuData) {
|
||||
const id = selectedSku.s1;
|
||||
@@ -71,4 +71,4 @@ SkuHeader.props = {
|
||||
selectedSku: Object
|
||||
};
|
||||
|
||||
export default sfc<SkuHeaderProps>(SkuHeader);
|
||||
export default createComponent<SkuHeaderProps>(SkuHeader);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { use } from '../../utils';
|
||||
import { createNamespace } from '../../utils';
|
||||
import Icon from '../../icon';
|
||||
import Loading from '../../loading';
|
||||
import Uploader from '../../uploader';
|
||||
|
||||
const [sfc, bem] = use('sku-img-uploader');
|
||||
const [createComponent, bem] = createNamespace('sku-img-uploader');
|
||||
|
||||
export default sfc({
|
||||
export default createComponent({
|
||||
props: {
|
||||
value: String,
|
||||
uploadImg: Function,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { use } from '../../utils';
|
||||
import { createNamespace } from '../../utils';
|
||||
import Cell from '../../cell';
|
||||
import CellGroup from '../../cell-group';
|
||||
import Field from '../../field';
|
||||
@@ -6,7 +6,7 @@ import { isEmail } from '../../utils/validate/email';
|
||||
import { isNumber } from '../../utils/validate/number';
|
||||
import SkuImgUploader from './SkuImgUploader';
|
||||
|
||||
const [sfc, bem] = use('sku-messages');
|
||||
const [createComponent, bem] = createNamespace('sku-messages');
|
||||
|
||||
const PLACEHOLDER = {
|
||||
id_no: '输入身份证号码',
|
||||
@@ -19,7 +19,7 @@ const PLACEHOLDER = {
|
||||
mobile: '输入手机号码'
|
||||
};
|
||||
|
||||
export default sfc({
|
||||
export default createComponent({
|
||||
props: {
|
||||
messages: Array,
|
||||
messageConfig: Object,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { use } from '../../utils';
|
||||
import { createNamespace } from '../../utils';
|
||||
import { inherit } from '../../utils/functional';
|
||||
|
||||
// Types
|
||||
@@ -10,7 +10,7 @@ export type SkuRowProps = {
|
||||
skuRow: SkuTreeItemData;
|
||||
};
|
||||
|
||||
const [sfc, bem] = use('sku-row');
|
||||
const [createComponent, bem] = createNamespace('sku-row');
|
||||
|
||||
function SkuRow(
|
||||
h: CreateElement,
|
||||
@@ -30,4 +30,4 @@ SkuRow.props = {
|
||||
skuRow: Object
|
||||
};
|
||||
|
||||
export default sfc<SkuRowProps>(SkuRow);
|
||||
export default createComponent<SkuRowProps>(SkuRow);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { use } from '../../utils';
|
||||
import { createNamespace } from '../../utils';
|
||||
import { isSkuChoosable } from '../utils/skuHelper';
|
||||
|
||||
const [sfc] = use('sku-row-item');
|
||||
const [createComponent] = createNamespace('sku-row-item');
|
||||
|
||||
export default sfc({
|
||||
export default createComponent({
|
||||
props: {
|
||||
skuList: Array,
|
||||
skuValue: Object,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { use } from '../../utils';
|
||||
import { createNamespace } from '../../utils';
|
||||
import Stepper from '../../stepper';
|
||||
import { LIMIT_TYPE } from '../constants';
|
||||
|
||||
const [sfc] = use('sku-stepper');
|
||||
const [createComponent] = createNamespace('sku-stepper');
|
||||
const { QUOTA_LIMIT, STOCK_LIMIT } = LIMIT_TYPE;
|
||||
|
||||
export default sfc({
|
||||
export default createComponent({
|
||||
props: {
|
||||
quota: Number,
|
||||
quotaUsed: Number,
|
||||
|
||||
Reference in New Issue
Block a user