Vue - slot-scope="scope" 的意義


     <template  slot-scope="scope">
                    <el-button type="primary" size="small" @click="$router.push(`/categories/edit/${scope.row._id}`)">編輯</el-button>    <!-- $router.push()  跳轉頁面 -->
                    <el-button type="primary" size="small" @click="remove(scope.row._id)">刪除</el-button> 
                </template>
 
  slot-scope="scope" 來取得作用域插槽:data綁定的數據,scope可以隨便替換其他名稱,只是定義對象來代表取得的data數據,便於使用


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM