提交 d76c78bf 编写于 作者: H hdx

call-method: 增加外部文件引用例子

上级 4942652c
......@@ -11,4 +11,9 @@ describe('call-method-easycom-uni-modules', () => {
const result = await page.callMethod('callMethodTest', title)
expect(result).toBe(title)
})
it('callMethodInOtherFile', async () => {
const title = Date.now() + ''
const result = await page.callMethod('callMethodInOtherFile', title)
expect(result).toBe(title)
})
})
\ No newline at end of file
export function testInOtherFile(instance: CallEasyMethodUniModulesComponentPublicInstance, text: string) : string {
return instance.foo5(text) as string;
}
......@@ -5,6 +5,8 @@
</template>
<script>
import { testInOtherFile } from './call-method-easycom-uni-modules'
export default {
data() {
return {
......@@ -43,6 +45,9 @@
const result = this.$callEasyMethod1!.foo5(text)! as string;
return result;
},
callMethodInOtherFile(text: string): string {
return testInOtherFile(this.$callEasyMethod1!, text);
},
}
}
</script>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册