vue template 标签,这个#代表啥意思?这个是怎样实现了什么功能?这和插槽有关系吗?

img


vue template 标签,这个#代表啥意思?这个是怎样实现了什么功能?这和插槽有关系吗?

v-slot 的缩写,即把参数之前的所有内容 (v-slot:) 替换为字符 #。例如 v-slot:header 可以被重写为 #header:

这是具名插槽的缩写吧,详细你的可以参照这个链接学习一下:
https://cn.vuejs.org/v2/guide/components-slots.html#%E5%85%B7%E5%90%8D%E6%8F%92%E6%A7%BD

类似于

<template slot-scope="scope"></template>