首次提交

This commit is contained in:
何江明
2025-02-28 16:19:58 +08:00
commit 15014e22aa
92 changed files with 15941 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
<template>
<view class="container">
<view>{{$t('schema.name')}}</view>
<input class="input" v-model="name" />
<button type="primary" @click="add">{{$t('schema.add')}}</button>
</view>
</template>
<script>
const collection = "hello";
export default {
data() {
return {
name: ""
}
},
methods: {
add() {
uni.showLoading();
let db = uniCloud.database()
db.collection(collection).add({
name: this.name
}).then((res) => {
uni.showToast({
title: this.$t('schema.add-success')
})
}).catch((err) => {
uni.showModal({
content: err.message,
showCancel: false
})
}).finally(() => {
uni.hideLoading();
})
}
}
}
</script>
<style>
.input {
border: 1px solid #ebebeb;
border-radius: 3px;
margin-top: 15px;
margin-bottom: 15px;
padding: 8px;
}
</style>