插座

更新时间:2021-12-21 01:38:54

SocketView

SocketView 插座组件

示图展示

插座

组件属性

字段名 类型 描述 默认值
socketWrapperStyle Style 外层样式 {}
socketBackgroundImage String 插座背景图片 ‘http://images.tuyacn.com/smart/panelos/common/imgs/1588928982565_dc-bg@3x.png’
socketBackgroundImageSize Style 插座背景图片样式 { width: 240, height: 240 }
socketImage String 插座图片 ‘http://images.tuyacn.com/smart/panelos/common/imgs/1588929002104_dc-ck-1@3x.png’
socketImageSize Style 插座图片样式 { width: 140, height: 140 }
onPress Func 插座点击回调 null

使用示例

import React from 'react';
import { View } from 'react-native';
import { SocketView } from '@tuya/tuya-panel-electrician-sdk';

const Scene = () => (
  <View style={{ flex: 1, alignItems: 'center', backgroundColor: 'grey' }}>
    <SocketView />
  </View>
);

export default Scene;