vue.js - Vue js模板标签
问题描述
我正在查看现有的 Vue 代码库,并且看到<template>
如下标签:
<template #default>
<template #content>
<template #close>
我知道每个 vue 组件都包含在<template>
标签中,但我以前从未见过#default
或#content
嵌入在模板标签中。这样做的目的是什么?我怀疑这些#
是可定制的,但你只需要定义它们?如果是这种情况,我在哪里可以在 vue 项目中找到它?我假设有一个标准位置可以在 vue 项目中存储这样的文件。谢谢你。
解决方案
#
在template
标签中只是 . 的简写v-slot:
。见:https ://v3.vuejs.org/guide/component-slots.html#named-slots-shorthand
推荐阅读
- vue.js - 环回抛出错误无法处理的实体
- json - 在 jsonnet 中使用条件参数导入
- regex - 你如何在 ruby 中获得正则表达式匹配组?
- python - 在 PyQT5 GUI 应用程序中运行一个活动窗口
- javascript - 关闭一个引导模式并立即打开另一个会导致滚动问题
- javascript - 未捕获的错误:打包程序未在 http://10.0.1.193:19002 处运行
- excel - 在 selenium vba 中执行代码期间从控制台获取值
- serial-port - 串行通信不返回确认是标准做法吗?
- spring-boot - 启动时 Spring Data GemFire 和 GemFire 缓存与 Spring Boot 之间的松散耦合
- r - 如何根据文件名中的日期选择目录中的文件并复制到另一个文件夹