perf(input): foucs blur 原生事件绑定
This commit is contained in:
		
							parent
							
								
									55fc38ac49
								
							
						
					
					
						commit
						5aa3544914
					
				@ -106,12 +106,12 @@ export default {
 | 
			
		||||
::: title input 属性
 | 
			
		||||
:::
 | 
			
		||||
 | 
			
		||||
| Name        | Description     | Accepted Values |
 | 
			
		||||
| ----------- | --------------- | --------------- |
 | 
			
		||||
| name        | 原始属性 name   | --              |
 | 
			
		||||
| placeholder | 提示信息        | --              |
 | 
			
		||||
| disabled    | 禁用            | `true` `false`  |
 | 
			
		||||
| v-model     | 值              | --              |
 | 
			
		||||
| input       | 原生 input 事件 | event : 事件对象  |
 | 
			
		||||
| foucs       | 原生 foucs 事件 | event : 事件对象  |
 | 
			
		||||
| blur        | 原生 blur 事件  | --  |
 | 
			
		||||
| Name        | Description     | Accepted Values  |
 | 
			
		||||
| ----------- | --------------- | ---------------- |
 | 
			
		||||
| name        | 原始属性 name   | --               |
 | 
			
		||||
| placeholder | 提示信息        | --               |
 | 
			
		||||
| disabled    | 禁用            | `true` `false`   |
 | 
			
		||||
| v-model     | 值              | --               |
 | 
			
		||||
| input       | 原生 input 事件 | event : 事件对象 |
 | 
			
		||||
| foucs       | 原生 foucs 事件 | event : 事件对象 |
 | 
			
		||||
| blur        | 原生 blur 事件  | --               |
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,8 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="layui-colla-item">
 | 
			
		||||
    <h2 class="layui-colla-title" @click="showHandle">
 | 
			
		||||
      {{ title }}<i class="layui-icon layui-colla-icon">{{ isShow ? '' : '' }}</i>
 | 
			
		||||
      {{ title
 | 
			
		||||
      }}<i class="layui-icon layui-colla-icon">{{ isShow ? '' : '' }}</i>
 | 
			
		||||
    </h2>
 | 
			
		||||
    <div class="layui-colla-content" :class="isShow ? 'layui-show' : ''">
 | 
			
		||||
      <p>
 | 
			
		||||
@ -14,13 +15,12 @@
 | 
			
		||||
<script setup name="LayCollapseItem" lang="ts">
 | 
			
		||||
import { defineProps, inject, ref } from 'vue'
 | 
			
		||||
 | 
			
		||||
const props =
 | 
			
		||||
  defineProps<{
 | 
			
		||||
    id: string
 | 
			
		||||
    title: string
 | 
			
		||||
  }>()
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
  id: string
 | 
			
		||||
  title: string
 | 
			
		||||
}>()
 | 
			
		||||
 | 
			
		||||
const openKeys = inject('openKeys') as String[]
 | 
			
		||||
const openKeys = inject('openKeys') as string[]
 | 
			
		||||
 | 
			
		||||
const isShow = ref(openKeys.includes(props.id))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -16,14 +16,13 @@
 | 
			
		||||
<script setup name="LayInput" lang="ts">
 | 
			
		||||
import { defineProps, defineEmits } from 'vue'
 | 
			
		||||
 | 
			
		||||
const props =
 | 
			
		||||
  defineProps<{
 | 
			
		||||
    name?: string
 | 
			
		||||
    type?: string
 | 
			
		||||
    modelValue?: string
 | 
			
		||||
    placeholder?: string
 | 
			
		||||
    disabled?: boolean
 | 
			
		||||
  }>()
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
  name?: string
 | 
			
		||||
  type?: string
 | 
			
		||||
  modelValue?: string
 | 
			
		||||
  placeholder?: string
 | 
			
		||||
  disabled?: boolean
 | 
			
		||||
}>()
 | 
			
		||||
 | 
			
		||||
const emit = defineEmits(['update:modelValue', 'input', 'focus', 'blur'])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user