edit-name.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="px3">
  3. <input
  4. v-if="name"
  5. type="text"
  6. v-model="name"
  7. placeholder="请输入姓名"
  8. placeholder-class="placeholder-class"
  9. />
  10. <input
  11. v-if="department"
  12. type="text"
  13. v-model="department"
  14. placeholder="请输入部门"
  15. placeholder-class="placeholder-class"
  16. />
  17. <button class="main-color-bg text-color-white mt-3" @tap="submit">保存</button>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. name: '',
  25. department: ''
  26. };
  27. },
  28. onLoad(options) {
  29. if (options && options.name) {
  30. uni.setNavigationBarTitle({
  31. title: '设置姓名'
  32. });
  33. this.name = options.name;
  34. } else if (options && options.department) {
  35. uni.setNavigationBarTitle({
  36. title: '设置部门'
  37. });
  38. this.department = options.department;
  39. }
  40. },
  41. methods: {
  42. submit() {}
  43. }
  44. };
  45. </script>
  46. <style lang="less" scoped>
  47. input {
  48. height: 100rpx;
  49. border-bottom: 1rpx solid #f4f4f4;
  50. }
  51. </style>