如果組件文檔里面用的是v-slot,而你用的是vue2.6之前的版本,則需要替換v-slot:所以有兩種替換方式,注意看兩塊v-slot有啥不同,你就知道你該怎么用slot-scope和slot來替換文檔中的v-slot了
v-slot使用方式1:
<template v-slot:operate="{ row }"><template>
則可替換為:
<template slot="operate" slot-scope="{ row }"></template>
v-slot使用方式2:
<template v-slot="{ row }"><template>
則可替換為:
<template slot-scope="row"></template>
先記錄后期再完善,趕項目去了
補充知識:V-for and slot-scoped報錯問題
此場景是為了用v-for動態渲染表格的slot
可能會這么寫
<a-table> <span v-for="(item, index) in header" :key="index" :slot="item.dataIndex" slot-scope="text" > {{ text }} </span> </a-table>
網站標題:v-slot和slot、slot-scope之間相互替換實例-創新互聯
當前網址:http://m.2m8n56k.cn/article14/dipsge.html
成都網站建設公司_創新互聯,為您提供自適應網站、ChatGPT、網站制作、App設計、企業建站、面包屑導航
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯