Comments (7)
For example normal slot
usage:
<Tab>
<TabHead slot="tabhead">
...
</TabHead>
</Tab>
Expect defining from component's inside as well:
// TabHead.js
const TabHead = {
name: 'TabHead',
render(h) {
return(
<div slot="tabhead">
...
</div>
)
}
}
from babel-plugin-transform-vue-jsx.
@rwu823, you can achieve that by doing:
export default {
render () {
return (
<div>
{this.$slots.tabhead
? <this.$slots.tabhead />
: <h1>Your content here</h1>}
</div>
)
}
}
instead of:
export default {
render () {
return (
<div slot="tabhead">
<h1>Your content here</h1>
</div>
)
}
}
from babel-plugin-transform-vue-jsx.
{this.$slots.default}
from babel-plugin-transform-vue-jsx.
any update?
from babel-plugin-transform-vue-jsx.
https://vuejs.org/guide/render-function.html#Functional-Components
https://vuejs.org/api/#vm-slots
from babel-plugin-transform-vue-jsx.
I'm not sure if I understand the original request...
from babel-plugin-transform-vue-jsx.
Wow, that actually worked!
I was trying to do this:
<VBreadcrumbs
class={{ "pl-0": true, [breadcrumbsStyle.root]: true }}
scopedSlots={{
item: ({ item }) => (
<VBreadcrumbsItem>
<VBtn
link
elevation={0}
small
color="transparent"
class="px-2"
onClick={() => {
console.log(item);
}}
>
{item.text}
</VBtn>
</VBreadcrumbsItem>
),
}}
slots={{
divider: () => [<VIcon>{mdiChevronRight}</VIcon>],
}}
items={this.breadcrumbs}
>
</VBreadcrumbs>
But this actually worked:
<VBreadcrumbs
class={{ "pl-0": true, [breadcrumbsStyle.root]: true }}
// divider={<VIcon>{mdiChevronRight}</VIcon>}
scopedSlots={{
item: ({ item }) => (
<VBreadcrumbsItem>
<VBtn
link
elevation={0}
small
color="transparent"
class="px-2"
onClick={() => {
console.log(item);
}}
>
{item.text}
</VBtn>
</VBreadcrumbsItem>
),
}}
items={this.breadcrumbs}
>
<div slot="divider">
<VIcon>{mdiChevronRight}</VIcon>
</div>
</VBreadcrumbs>
from babel-plugin-transform-vue-jsx.
Related Issues (20)
- how to pass a prop named "model" to the custom component like el-form
- `h` is not auto-injected with Laravel-Mix and Vue using @vue/babel-plugin-transform-vue-jsx v1.0.0-beta.3 HOT 1
- sass content in .vue file not compiled HOT 1
- Concrete preset instead on env HOT 1
- Vuetify modifiers behave differently
- Vue 3 and TSX HOT 6
- rollup+babel+babel-plugin-transform-vue-jsx package size so big
- delete this
- delete this
- delete this
- delete this
- JSX fragment syntax (<> ... </>) HOT 4
- How to add JSX Support to Existing MVC .NET Application
- How to add 'comments' in vue jsx HOT 2
- JSX compilation fails when nested under another node_modules directory
- Support for xmlns:xlink attribute
- how to write the arguments of the custom directives? HOT 2
- String turn into jsx code HOT 1
- [Question] How to use emits in component ?
- Convert JSX to string in template
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 babel-plugin-transform-vue-jsx.