@bsgoal/common 2.7.0 → 2.7.1

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": "@bsgoal/common",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-05-29 09:38:59
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-29 10:00:37
5
+ * @LastEditTime: 2023-05-29 18:01:43
6
6
  * @FilePath: \common\src\components\bsgoal-base-input\demo.vue
7
7
  * @Description: Input 输入框 演示
8
8
  *
@@ -19,12 +19,17 @@ const props = defineProps({})
19
19
 
20
20
  const inputValue = ref('')
21
21
 
22
+ const test = () => {
23
+ inputValue.value = '666'
24
+ }
25
+
22
26
  </script>
23
27
  <template>
24
28
  <div class="bsgoal-base-input-demo">
25
29
  <div class="base_input_demo">
26
30
  {{ inputValue }}
27
31
  <BsgoalBaseInput v-model="inputValue"/>
32
+ <el-button type="primary" @click="test">测试</el-button>
28
33
  </div>
29
34
  </div>
30
35
  </template>
@@ -2,7 +2,7 @@
2
2
  * @Author: canlong.shen
3
3
  * @Date: 2023-05-29 09:38:52
4
4
  * @LastEditors: canlong.shen
5
- * @LastEditTime: 2023-05-29 11:41:48
5
+ * @LastEditTime: 2023-05-29 18:01:19
6
6
  * @FilePath: \common\src\components\bsgoal-base-input\index.vue
7
7
  * @Description: Input 输入框
8
8
  *
@@ -11,7 +11,8 @@
11
11
  <script setup>
12
12
  /* setup模板
13
13
  ---------------------------------------------------------------- */
14
- import { ref, watch } from 'vue'
14
+ import { processSlotOutlet } from '@vue/compiler-core'
15
+ import { ref, watch, watchEffect } from 'vue'
15
16
 
16
17
  defineOptions({
17
18
  name: 'BsgoalBaseInput'
@@ -63,9 +64,10 @@ const emits = defineEmits(['update:modelValue', 'change'])
63
64
 
64
65
  // ---> S 值绑定 <---
65
66
 
66
- const inputValue = ref(props.modelValue)
67
- watch(inputValue, (value = '') => {
68
- emits('update:modelValue', value)
67
+ const inputValue = ref('')
68
+
69
+ watchEffect(() => {
70
+ inputValue.value = props.modelValue
69
71
  })
70
72
 
71
73
  // ---> E 值绑定 <---
@@ -74,12 +76,33 @@ watch(inputValue, (value = '') => {
74
76
 
75
77
  /**
76
78
  * @Author: canlong.shen
77
- * @description: 值变动
79
+ * @description: 触发 变动输入
78
80
  * @default:
79
81
  * @return {*}
80
82
  */
81
83
  const change = (value = '') => {
82
84
  emits('change', value)
85
+ emits('update:modelValue', value)
86
+ }
87
+ /**
88
+ * @Author: canlong.shen
89
+ * @description: 触发 清空输入
90
+ * @default:
91
+ * @return {*}
92
+ */
93
+ const clear = (value = '') => {
94
+ emits('clear', value)
95
+ emits('update:modelValue', value)
96
+ }
97
+ /**
98
+ * @Author: canlong.shen
99
+ * @description: 触发 输入事件
100
+ * @default:
101
+ * @return {*}
102
+ */
103
+ const input = (value = '') => {
104
+ emits('input', value)
105
+ emits('update:modelValue', value)
83
106
  }
84
107
 
85
108
  // ---> E 事件 <---
@@ -96,6 +119,8 @@ const change = (value = '') => {
96
119
  :formatter="formatter"
97
120
  :parser="parser"
98
121
  @change="change"
122
+ @clear="clear"
123
+ @input="input"
99
124
  />
100
125
  </div>
101
126
  </template>