新建云对象

hello 为自定义的云对象名称


编辑云对象
uniCloud-aliyun/cloudfunctions/hello/index.obj.js
module.exports = {
	say(name) {
		return `你好,${name}`
	}
}使用云对象
pages/index/index.vue
<button @click="test_cloudObj">调用云对象</button>methods: {
	async test_cloudObj() {
		const cloudObj_hello = uniCloud.importObject('hello')
		let res = await cloudObj_hello.say('张三')
		console.log(res)
	}
}开发调试时,使用的本地云对象

上传部署云对象
生产环境使用的云端云对象,所以需上传部署云对象

 测试时,使用云端云对象

                









