From 77a188ba2426ec4d4de9fa671774e70a8f0aeff1 Mon Sep 17 00:00:00 2001 From: Liou <1509145823@qq,com> Date: Tue, 8 Jun 2021 11:39:40 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\210\230\346\263\242/2021-6-8.md" | 44 ++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 "\345\210\230\346\263\242/2021-6-8.md" diff --git "a/\345\210\230\346\263\242/2021-6-8.md" "b/\345\210\230\346\263\242/2021-6-8.md" new file mode 100644 index 0000000..6f8cc10 --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-8.md" @@ -0,0 +1,44 @@ +# Vue的第九天 +* 组件中的data必须是一个函数,且必须要返回一个对象 +* 组件的复用 +``` + + + + + Vue.component("todo",{ + data:function(){ + return{ + sum:0 + } + }, + template:`` + }); +``` +* 通过props向组件中的子组件传递数据 +``` + + + + +Vue.component("todo",{ + props:["title"], + template:`

{{title}}

` + }); +``` +* 组件的子组件只能有一个标签,但是可以用父元素来解决问题 +``` +Vue.component("todo",{ + props:["title"], + template:` +
+

{{title}}

+

{{title}}

+
+ ` + }); +``` +* 监听子组件$emit方法 +``` + +``` \ No newline at end of file -- Gitee From 1ddaa142cbab5b8ccc0d96c1ccfcce38de6ffe7c Mon Sep 17 00:00:00 2001 From: Liou <1509145823@qq.com> Date: Wed, 9 Jun 2021 12:15:41 +0800 Subject: [PATCH 2/5] tijiao --- "\345\210\230\346\263\242/2021-6-8.md" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git "a/\345\210\230\346\263\242/2021-6-8.md" "b/\345\210\230\346\263\242/2021-6-8.md" index 6f8cc10..3394c10 100644 --- "a/\345\210\230\346\263\242/2021-6-8.md" +++ "b/\345\210\230\346\263\242/2021-6-8.md" @@ -40,5 +40,23 @@ Vue.component("todo",{ ``` * 监听子组件$emit方法 ``` + + +Vue.component("todo",{ + props:["title"], + template:`
  • {{title.name}}
  • ` + }) +``` +* $emit第二个元素可以抛出一个值 +``` + + + Vue.component("todo",{ + props:["title"], + template:`
  • {{title.name}}
  • ` + }) +``` +* v-model在组件中使用 +``` ``` \ No newline at end of file -- Gitee From 0df3053cd7dce6b855cbbb53a791690398e9212b Mon Sep 17 00:00:00 2001 From: Liou <1509145823@qq.com> Date: Wed, 9 Jun 2021 16:51:40 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\210\230\346\263\242/2021-6-9.md" | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 "\345\210\230\346\263\242/2021-6-9.md" diff --git "a/\345\210\230\346\263\242/2021-6-9.md" "b/\345\210\230\346\263\242/2021-6-9.md" new file mode 100644 index 0000000..823629b --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-9.md" @@ -0,0 +1,10 @@ +# Vue的第十天 +* 官方cli的安装 +* npm i -g yarn安装yarn +* yarn global add @vue/cli安装脚手架 +* yarn config set registry https://registry.npm.taobao.org设置淘宝镜像安装更快 +* 安装完后此电脑-属性-高级设置-环境变量-系统变量-path-(c:user/admin/appdata/local/yarn/bin) +* create Vue创建文件 +* 将创建项目打包 npm run build +* 项目可以挂载到nginx上浏览 +* 打开C:\Windows\System32\drivers\etc\hosts文件修改权限然后进入文件添加47.115.30.85 text.icu -- Gitee From ec815e1e34a7abe184d9f39eb5062242da11b9cb Mon Sep 17 00:00:00 2001 From: Liou <1509145823@qq.com> Date: Fri, 11 Jun 2021 10:39:33 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\210\230\346\263\242/2021-6-11.md" | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 "\345\210\230\346\263\242/2021-6-11.md" diff --git "a/\345\210\230\346\263\242/2021-6-11.md" "b/\345\210\230\346\263\242/2021-6-11.md" new file mode 100644 index 0000000..44cc93c --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-11.md" @@ -0,0 +1,4 @@ +# Vue的第十一天 +* 在liunx上安装Vue脚手架 +* 确保安装了node.js npm 以及yarn +* 安装脚手架后不需要环境变量配置其它照旧 \ No newline at end of file -- Gitee From 0d15a296433b4d164a5413946f7db0bad86f2205 Mon Sep 17 00:00:00 2001 From: Liou <1509145823@qq.com> Date: Sat, 12 Jun 2021 16:20:54 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\210\230\346\263\242/2021-6-12.md" | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 "\345\210\230\346\263\242/2021-6-12.md" diff --git "a/\345\210\230\346\263\242/2021-6-12.md" "b/\345\210\230\346\263\242/2021-6-12.md" new file mode 100644 index 0000000..4877813 --- /dev/null +++ "b/\345\210\230\346\263\242/2021-6-12.md" @@ -0,0 +1,51 @@ +# Vue的第十二天 +* npm install -g yarn @vue/cli 脚手架和Vue同时安装不需要环境配置 +* app.vue中添加主键 +``` + +``` +* 使用v-for +``` + + {{ item.hname }} + {{ item.xname }} + {{ item.yname }} + + +export default { + data: function () { + return { + zoolist: [ + { + id: 1, + hname: "大毛", + xname: "大红", + yname: "小猴", + }, + ], + }; + }, +}; + +``` +* 插入数据 +``` +

    {{titile}}

    + +props:{ + titile:{ + type:String, + default:"今天是个好日子" + } + }, +``` \ No newline at end of file -- Gitee