Sources 参考来源
展示带编号或标记的来源集合。
交互示例
交互示例加载中…
用法
<Sources items={sources} onPress={(item) => openSource(item)} />
行为与接入
默认标题为“参考来源”。label、顺序、来源关系、标题与说明都由消费者提供;点击事件返回原项。
禁用项不交付点击事件。组件不查询来源、不核实信息,也不自动打开链接;正文里的独立标记可使用 Citation。
API
查看完整 TypeScript 类型
以下内容由包根公开类型生成,与当前源码保持一致。
import type { StyleProp, ViewStyle } from 'react-native';
export interface SourceItem {
id: string;
label: string;
title?: string;
description?: string;
disabled?: boolean;
}
export interface SourcesProps {
items: readonly SourceItem[];
title?: string;
onPress?(item: SourceItem): void;
style?: StyleProp<ViewStyle>;
testID?: string;
}