problemAdd.vue 706 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <view class="center">
  3. <view class="login_name"><input class="uni-input" v-model="title" focus placeholder="标题" /></view>
  4. <input class="text" v-model="content" focus placeholder="内容"></input>
  5. <view class="buttom" @click="nav('/pages/course/success')">
  6. 提交
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. import { setProblem } from '@/api/problem.js'
  12. export default {
  13. data(){
  14. return{
  15. title:'',
  16. content:''
  17. }
  18. },
  19. methods: {
  20. nav(url){
  21. setProblem({
  22. title: this.title,
  23. content: this.content
  24. }).then(e =>{
  25. uni.navigateTo({
  26. url:url
  27. })
  28. }).cache(err =>{
  29. console.log(err)
  30. })
  31. }
  32. }
  33. }
  34. </script>
  35. <style>
  36. .text{
  37. height: 300rpx;
  38. }
  39. </style>