Comments (3)
If I had to guess, OP wants a way to read the available slot names from a component definition at runtime or something like that?
Not sure though ...
from core.
@el-j can you provide more information
Seems to be working to me playground
import { defineSlots } from 'vue'
const slots = defineSlots<{ a: () => any }>()
slots.a()
//@ts-expect-error
slots.aaa()
from core.
Hi, yes so indeed it's not about define slots and use them in the component. Its about useing the component and know the possible slot names or generically put in/fill all possible slots.
Sorry if i was not clear on that.
If i import a component i can get slmething like
component.props
but cannot get component.slots
(or emits...(but that might be another issue)
I would love to import a component and consider the slots and their content from within the script section. I am writting in typescript sfc style.
from core.
Related Issues (20)
- Inconsistent behaviour in `Transition` component and lifecycle hooks like `onBeforeUnmount` and `onUnmounted` HOT 1
- toggle event throws error on details element HOT 1
- Radio input element's checked value not synced with props checked. HOT 3
- When using vue3, main.js automatically adds printing appz
- When using vue3, when main.js is running, the automatic addition of printing appz appears. HOT 1
- jsx 三元运算非预期 HOT 2
- vue webcomponent 里使用vue组件,组件内部样式丢失 HOT 3
- Failed to resolve import source when using PNPM
- scoped css [data="xyz"] is applied to wrong element HOT 2
- watchEffect 没触发 HOT 2
- Unintentional $event value setting on customized event HOT 2
- Blank screen when scaffolding project with ts (related to Vue Router) HOT 1
- Custom elements not able to associate with form HOT 1
- Cannot determine prop from mapped type
- vue-component-meta: Invalid component prop types when using options api + a prop with a default function HOT 2
- Computed re render is inconsistent. HOT 2
- `watch` a ref props object not take effect HOT 2
- Why is the memory consumption of my Vue project unusually high?
- Discrepancy of expose/defineExpose TS types (and functionality) across different Vue modes HOT 1
- ref回调错误 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.