<template>
<div>
<div @click="set()">点击</div>
</div>
</template>
<script>
window["submitFile"] = val => {
Platform.selectFile(0)
};
export default {
created(){
this.set();
},
methods:{
set() {
submitFile()
},
getData (){
Platform.submitFile()
}
},
mounted(){
window["showContent"] = val => {
this.getData(val);
};
}
};
</script>
第一步:安卓丢一个方法过来,比如说:submitFile,前端就可以这样全局调了window["submitFile"] = val => {
Platform.selectFile(0)
};这个是Platform.selectFile(0)前缀
getdata(){
alter(“调用一个")
}
window["showContent"] = val => {
this.getData(val);
};