Skip to content

Some type definitions are not available in template blocks #616

@Ruhangs

Description

@Ruhangs

Details are as follows:
auto-import.d.ts:

import { UnwrapRef } from 'vue'
declare module 'vue' {
  interface GlobalComponents {}
  interface ComponentCustomProperties {
      readonly PAGE_SIZE: UnwrapRef<typeof import('../constants/common')['PAGE_SIZE']>
  }
}

code:

 <el-pagination v-model:current-page="pagination.page"
                     v-model:pageSize="pagination.pageSize"
                     :total="pagination.total"
                     :pager-count="5"
                     size="small"
                     layout="sizes, prev, pager, next"
                     :page-sizes="PAGE_SIZE"
                     @current-change="loadData"
                     @size-change="loadData" />

When declared with declare module ‘vue’, PAGE_SIZE will report a type error in the template, but it will return to normal when manually replaced with declare module ‘@vue-runtime-core’. Can this be selected in configuration items?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions