journal.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view class="ss-p-x-30 ss-p-y-30">
  3. <uni-easyinput type="textarea" v-model="journal" clearable maxlength="500" autoHeight placeholder="请输入要记录的内容" />
  4. <view class="f-horizon-center">
  5. <button
  6. v-if="editId"
  7. size="default"
  8. class="delete-button commonBtnStyle"
  9. :disabled="deleteDisabled"
  10. @click="handleDelete"
  11. >删 除</button>
  12. <button
  13. size="default"
  14. :class="{'save-button': editId, 'commonBtnStyle': editId, 'send-button': !editId}"
  15. @click="handleSubmit"
  16. :disabled="disabled"
  17. >保 存</button>
  18. </view>
  19. </view>
  20. </template>
  21. <script setup>
  22. import { ref } from 'vue'
  23. import { onLoad } from '@dcloudio/uni-app'
  24. const editId = ref(null)
  25. const journal = ref(null)
  26. const disabled = ref(false)
  27. const deleteDisabled = ref(false)
  28. onLoad((options) => {
  29. editId.value = options?.id || null
  30. journal.value = options?.text || null
  31. })
  32. const handleDelete = () => {}
  33. const handleSubmit = async () => {
  34. }
  35. </script>
  36. <style lang="scss" scoped>
  37. </style>