src="/uploads/allimg/220723/0Q44B001-1.jpg"> src="/uploads/allimg/220723/0Q4461b5-2.jpg"> >//slot:插槽Vue.component("todo", {template: '\\ \\ \'});Vue.component("todo-title", {pr。前端开发|Vue篇——插槽slot简单实例。" />

前端开发|Vue篇——插槽slot简单实例

上代码

Vue - 锐客网
src="http://img.readke.com/220723/0Q44613V-0.jpg"> src="http://img.readke.com/220723/0Q44B001-1.jpg"> src="http://img.readke.com/220723/0Q4461b5-2.jpg">>//slot:插槽 Vue.component("todo", { template: '\ \
    \ \
\ ' }); Vue.component("todo-title", { props: ['title'], template: '{{title}}' }); Vue.component("todo-items", { props: ['item'], template: '
  • {{item}}
  • ' }); var vm = new Vue({ el: "#vue", data: { Title: "四月书屋", todoItems: ['Java', '数据库', '网络基础'] }});

      推荐阅读