UNPKG

936 BTypeScriptView Raw
1import { ComponentType } from 'react'
2
3import { StandardProps } from './common'
4
5interface ScriptProps extends StandardProps {
6 /** xs 文件的相对路径
7 * @supported weapp, alipay, swan, tt, qq, jd
8 */
9 src: string
10 /** xs 模块名
11 * @supported weapp, alipay, swan, tt, qq, jd
12 */
13 module: string
14}
15
16/** script 类似微信小程序的 wxs 标签,支持引用各种小程序的 xs 文件
17 * 只能在 CompileMode 中使用
18 * @classification viewContainer
19 * @supported weapp, swan, alipay, tt, jd, qq
20 * @example_react
21 * ```tsx
22 * import { Component } from 'react'
23 * import { View, Script } from '@tarojs/components'
24 *
25 * export function Index () {
26 * return (
27 * <View compileMode>
28 * <Script src="./logic.wxs" module="logic"></Script>
29 * <Text>Hello, {logic.name}!</Text>
30 * </View>
31 * )
32 * }
33 * ```
34 */
35declare const Script: ComponentType<ScriptProps>
36
37export { Script, ScriptProps }
38
\No newline at end of file