// util.sjs
export default {
message: 'hello alipay',
getmsg: x => x,
};
<import-sjs name="util" from="./util.sjs"/>
<view> 使用变量 {{util.message}}view>
<view> 使用函数 {{util.getmsg(msg)}}view>
// helper.sjs
export const a = 1;
export function b() { return 2 }
<import-sjs from="./helper.sjs" name="{ a, b: c }"/>
<view>{{ c() }}:{{a}}:{{ b }}view>
<view>{{ 2 }}:{{ 1 }}:{{ undefined }}view>