更新依赖,code lint

This commit is contained in:
lyswhut
2023-05-19 22:01:18 +08:00
parent bd5107bbaf
commit fe94a1eac9
74 changed files with 1537 additions and 1210 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ export default {
default: false,
},
},
emits: ['update:modelValue', 'change'],
emits: ['update:model-value', 'change'],
data() {
return {
checked: false,
@@ -80,7 +80,7 @@ export default {
modelValue = checked
} else modelValue = checked ? this.value : ''
}
this.$emit('update:modelValue', modelValue)
this.$emit('update:model-value', modelValue)
this.$emit('change', modelValue)
},
setValue(value) {
+3 -3
View File
@@ -52,7 +52,7 @@ export default {
// default: true,
// },
},
emits: ['update:modelValue', 'submit', 'change'],
emits: ['update:model-value', 'submit', 'change'],
methods: {
handleInput(event) {
let value = event.target.value
@@ -60,7 +60,7 @@ export default {
value = value.trim()
event.target.value = value
}
this.$emit('update:modelValue', value)
this.$emit('update:model-value', value)
},
focus() {
this.$refs.dom_input.focus()
@@ -78,7 +78,7 @@ export default {
// if (dom_input.selectionStart == dom_input.selectionEnd) {
const value = text.substring(0, dom_input.selectionStart) + str + text.substring(dom_input.selectionEnd, text.length)
event.target.value = value
this.$emit('update:modelValue', value)
this.$emit('update:model-value', value)
// } else {
// clipboardWriteText(text.substring(dom_input.selectionStart, dom_input.selectionEnd))
// }
+2 -2
View File
@@ -48,13 +48,13 @@ export default {
default: 'name',
},
},
emits: ['update:modelValue', 'menu-click'],
emits: ['update:model-value', 'menu-click'],
setup(props, { emit }) {
const visible = computed(() => props.modelValue)
const location = computed(() => props.xy)
const onHide = () => {
emit('update:modelValue', false)
emit('update:model-value', false)
menuClick(null)
}
+1 -1
View File
@@ -17,7 +17,7 @@
</template>
<script setup lang="ts">
import { ref, watch, onMounted, onBeforeUnmount, reactive, defineEmits } from '@common/utils/vueTools'
import { ref, watch, onMounted, onBeforeUnmount, reactive } from '@common/utils/vueTools'
// https://github.com/vuejs/core/issues/2855#issuecomment-768388962
import {
+2 -2
View File
@@ -42,7 +42,7 @@ export default {
default: '',
},
},
emits: ['update:modelValue', 'change'],
emits: ['update:model-value', 'change'],
data() {
return {
show: false,
@@ -84,7 +84,7 @@ export default {
handleClick(item) {
// console.log(this.modelValue)
if (item === this.modelValue) return
this.$emit('update:modelValue', this.itemKey ? item[this.itemKey] : item)
this.$emit('update:model-value', this.itemKey ? item[this.itemKey] : item)
this.$emit('change', item)
},
handleShow() {
+2 -2
View File
@@ -37,11 +37,11 @@ export default {
default: '',
},
},
emits: ['update:modelValue', 'change'],
emits: ['update:model-value', 'change'],
setup(props, { emit }) {
const handleToggle = id => {
if (id == props.modelValue) return
emit('update:modelValue', id)
emit('update:model-value', id)
emit('change', id)
}