NVUE页面调试经常报错,不知道为什么
This commit is contained in:
48
pages/im/group/create.vue
Normal file
48
pages/im/group/create.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<view>
|
||||
<u--input placeholder="请输入内容" border="surround" v-model="group_name"></u--input>
|
||||
|
||||
<u-button type="primary" text="确定" @click="onCreate"></u-button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
createGroup
|
||||
} from '@/apis/interfaces/im.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
group_name: '',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
onCreate() {
|
||||
console.log('阿斯利康');
|
||||
createGroup({
|
||||
name: this.group_name
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
uni.showToast({
|
||||
title: '创建成功'
|
||||
})
|
||||
uni.navigateBack()
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: err
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user