bri-components 1.4.6 → 1.4.7-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.4.6",
3
+ "version": "1.4.7-0",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -349,15 +349,21 @@
349
349
  },
350
350
  // 点击文件编辑
351
351
  clickEdit (operationItem, fileItem) {
352
- let lastIndex = fileItem.name.lastIndexOf(".");
353
- let formate = fileItem.name.substring(lastIndex);
352
+ let fileName = fileItem.name;
353
+ const lastIndex = fileName.lastIndexOf(".");
354
+ const formate = fileName.substring(lastIndex);
355
+ fileName = fileName.substring(0, lastIndex);
354
356
 
355
357
  this.$Modal.confirm({
356
358
  title: "修改名称",
357
359
  render: (h) => {
360
+ // // 第二种方式
361
+ // const lastIndex = fileName.lastIndexOf(".");
362
+ // const formate = fileName.substring(lastIndex);
363
+
358
364
  return h("Input", {
359
365
  props: {
360
- value: fileItem.name.substring(0, lastIndex),
366
+ value: fileName,
361
367
  autofocus: true,
362
368
  placeholder: "请输入名称"
363
369
  },
@@ -366,12 +372,13 @@
366
372
  },
367
373
  on: {
368
374
  input: (val) => {
369
- fileItem.name = val + formate;
375
+ fileName = val;
370
376
  }
371
377
  }
372
378
  });
373
379
  },
374
380
  onOk: () => {
381
+ fileItem.name = fileName + formate;
375
382
  this.$emit("editItemName", fileItem);
376
383
  },
377
384
  onCancel: () => {}