加入VxeTable,逐步替换shallowRef为useTemplateRef

This commit is contained in:
xh
2025-07-19 13:00:40 +08:00
parent 08951237da
commit 5f15d0eb81
29 changed files with 205 additions and 112 deletions
+3 -3
View File
@@ -24,7 +24,7 @@
</div>
</template>
<script lang="ts" setup>
import { ref, computed, shallowRef, reactive } from 'vue'
import { ref, computed, reactive, useTemplateRef } from 'vue'
import type { FormInstance } from 'element-plus'
import { user_protocol_edit, user_protocol_add, user_protocol_detail } from '@/api/user/protocol'
import Popup from '@/components/popup/index.vue'
@@ -41,8 +41,8 @@ defineProps({
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const formRef = useTemplateRef<FormInstance>('formRef')
const popupRef = useTemplateRef<InstanceType<typeof Popup>>('popupRef')
const mode = ref('add')
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑用户协议' : '新增用户协议'