Skip to content

Instantly share code, notes, and snippets.

@ocpinfo
Last active April 26, 2024 08:46
Show Gist options
  • Save ocpinfo/3b50d23224d032f3e134a8dfb0fb0f22 to your computer and use it in GitHub Desktop.
Save ocpinfo/3b50d23224d032f3e134a8dfb0fb0f22 to your computer and use it in GitHub Desktop.
Use renderjs to support Fetch usage for APP.vue in Uniapp environment
The demo code is as below:
<template>
<view @click="test.qafetch" data-role="button" >
<span class="ui-text ">发 送</span>
</view>
</template>
<script module="test" lang="renderjs">
export default {
data() {
return {
title: 'Hello',
}
},
methods: {
async qafetch() {
//Just clone from your original 'fetch javascript code' 这里把你原来fetch相关的代码直接复制过来就可以用
},
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment