Subscribe on changes!

Setup语法糖语法中没有this实例,我改怎么获取this.$slots?

avatar
Jul 25th 2021

Version

3.2.0-beta.5

Reproduction link

[https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8ZGl2PlxuICAgIHt7bXNnfX1cbiAgPC9kaXY XG48L3RlbXBsYXRlPlxuXG48c2NyaXB0IHNldHVwPlxuY29uc3QgbXNnID0gJ0hlbGxvIFdvcmxkISdcbmNvbnNvbGUubG9nKHRoaXMuJHNsb3RzKVxuPC9zY3JpcHQ In0=](https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8ZGl2PlxuICAgIHt7bXNnfX1cbiAgPC9kaXY XG48L3RlbXBsYXRlPlxuXG48c2NyaXB0IHNldHVwPlxuY29uc3QgbXNnID0gJ0hlbGxvIFdvcmxkISdcbmNvbnNvbGUubG9nKHRoaXMuJHNsb3RzKVxuPC9zY3JpcHQ In0=)

Steps to reproduce

Setup语法糖语法中没有this实例,我改怎么获取this.$slots?

What is expected?

Setup语法糖语法中没有this实例,我改怎么获取this.$slots?

What is actually happening?

Setup语法糖语法中没有this实例,我改怎么获取this.$slots?

avatar
Jul 25th 2021

Please open a new issue with a link that works and in English

avatar
Jul 26th 2021

@LBJDJW

import { useSlots } from 'vue'

//...
const slots = useSlots()
avatar
Jul 26th 2021

THANK YOU