parent
3851de35ca
commit
0e9f957a25
|
@ -52,5 +52,7 @@ export * from '@primevue/core/baseinput';
|
|||
export * from '@primevue/core/config';
|
||||
export { default as PrimeVue } from '@primevue/core/config';
|
||||
export * from '@primevue/core/service';
|
||||
export * from '@primevue/core/useattrselector';
|
||||
export * from '@primevue/core/useid';
|
||||
export * from '@primevue/core/usestyle';
|
||||
export * from '@primevue/core/utils';
|
||||
|
|
|
@ -25,6 +25,12 @@ export { default as PrimeVue } from '@primevue/core/config';
|
|||
// PrimeVueService
|
||||
export { default as PrimeVueService } from '@primevue/core/service';
|
||||
|
||||
// UseAttrSelector
|
||||
export * from '@primevue/core/useattrselector';
|
||||
|
||||
// UseId
|
||||
export * from '@primevue/core/useid';
|
||||
|
||||
// UseStyle
|
||||
export * from '@primevue/core/usestyle';
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export declare function useAttrSelector(prefix?: string): string;
|
|
@ -0,0 +1,7 @@
|
|||
import { useId } from 'vue';
|
||||
|
||||
export function useAttrSelector(prefix = 'pc') {
|
||||
const idx = useId();
|
||||
|
||||
return `${prefix}${idx.replace('v-', '').replaceAll('-', '_')}`;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"main": "./UseAttrSelector.js",
|
||||
"module": "./UseAttrSelector.js",
|
||||
"types": "./UseAttrSelector.d.ts"
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export declare function useId(initialValue?: string): string;
|
|
@ -0,0 +1,8 @@
|
|||
import { ref, toValue, useId as vueUseId } from 'vue';
|
||||
|
||||
export function useId(initialValue) {
|
||||
const idx = vueUseId();
|
||||
const id = ref(initialValue);
|
||||
|
||||
return toValue(id) || `pv_id${toValue(idx)?.replaceAll(/v-|-/g, '_')}`;
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"main": "./UseId.js",
|
||||
"module": "./UseId.js",
|
||||
"types": "./UseId.d.ts"
|
||||
}
|
|
@ -54,6 +54,8 @@ const ALIAS_ENTRIES = [
|
|||
{ find: '@primevue/core/baseinput', replacement: path.resolve(__dirname, '../core/src/baseinput/BaseInput.vue') },
|
||||
{ find: '@primevue/core/config', replacement: path.resolve(__dirname, '../core/src/config/PrimeVue.js') },
|
||||
{ find: '@primevue/core/service', replacement: path.resolve(__dirname, '../core/src/service/PrimeVueService.js') },
|
||||
{ find: '@primevue/core/useattrselector', replacement: path.resolve(__dirname, '../core/src/useattrselector/UseAttrSelector.js') },
|
||||
{ find: '@primevue/core/useid', replacement: path.resolve(__dirname, '../core/src/useid/UseId.js') },
|
||||
{ find: '@primevue/core/usestyle', replacement: path.resolve(__dirname, '../core/src/usestyle/UseStyle.js') },
|
||||
{ find: '@primevue/core/utils', replacement: path.resolve(__dirname, '../core/src/utils/Utils.js') },
|
||||
{ find: '@primevue/core', replacement: path.resolve(__dirname, '../core/src/index.js') },
|
||||
|
|
Loading…
Reference in New Issue