editShelf.vue 860 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <view style="padding: 1rem;background: #fff;width:100%;height: 100vh;" class="flex flex_column">
  3. <view style="flex:1;"><u-input style="border-radius: 50rpx;" height="90" :maxlength="30" v-model="shelfName" border placeholder="请输入货架名称(最多30个字符)"></u-input></view>
  4. <view><u-button @click="save" shape="circle" type="primary">保存</u-button></view>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. data() {
  10. return {
  11. shelfName: ''
  12. }
  13. },
  14. onLoad(opts) {
  15. this.shelfName = opts.shelfName
  16. },
  17. methods: {
  18. save(){
  19. if(this.shelfName&&this.shelfName.replace(/\s+/g,'') != ''){
  20. uni.$emit('editShelfName',{shelfName: this.shelfName})
  21. uni.navigateBack()
  22. }else{
  23. uni.showToast({
  24. icon:"none",
  25. title: "请输入货架名称"
  26. })
  27. }
  28. }
  29. }
  30. }
  31. </script>
  32. <style>
  33. </style>